[ 3 / a / adv / an / asp / cgl / ck / co / diy / fa / g / gd / int / jp / k / lit / m / mlp / mu / n / o / out / p / po / sci / sp / tg / toy / trv / tv / v / vg / vp / vr / w / wsg / x]

/sci/ - Science & Math

<< back to board
[Delete this thread]

File: 222.jpg-(16 KB, 259x194)
Can someone explain me this,...
Anonymous 09/04/14(Thu)18:59 UTC+1 No.6735299 Report

Can someone explain me this, please? Much appreciated
>>
Anonymous 09/04/14(Thu)19:00 UTC+1 No.6735301 Report

>>6735299
Sorry, heres the problem

Assume unsigned binary numbers and the existence of a logical right shift operation represented by the symbol >>. The >> operation moves bits to the right by a given number of positions. The vacant high-order bits are zeroed, while the low-order bits are discarded. For example, 1100 >> 2 will produce the result 0011, and 100111 >> 3 will produce 000100. Explain how you can use a logical right shift operation to divide a number by a power of two.
>>
Anonymous 09/04/14(Thu)19:06 UTC+1 No.6735309 Report

Serious question, are you retarded?
>>
Anonymous 09/04/14(Thu)19:09 UTC+1 No.6735316 Report

>>6735309
Might be, yeah
>>
Anonymous 09/04/14(Thu)19:11 UTC+1 No.6735319 Report

well, how would you use a left shift operation to multiply a number by a power of two? think about a simple case, like the number 8.
>>
Anonymous 09/04/14(Thu)19:19 UTC+1 No.6735331 Report

Are you asking how 1100 >> 2 is the same as 12/4? Just think about it for a second. In binary each digit represents a power of two. The power is the same as the digit place. So if say the number is 10000 = 16 = 2^4, the one is in the 4th digit, you shift that number by 1 it becomes 01000 = 8 = 2^3. By reducing the power you are dividing the number by 2 each time.
>>
Anonymous 09/04/14(Thu)19:21 UTC+1 No.6735335 Report

>>6735301
Binary is a base two number system, by right shifting the bits you are essentially dividing that number by two^(number of right shifts). Kind of like in base 10 when you move the significant digit to the right you get a division by 10. 100 becomes 010 which is 10, or a division by 10^1.

Some examples.
11(2) >> 01(1) 2/2=1
1010(10) >> 0101(5) 10/2=5
1100(12) >> >> 0011(3) 12/2^2=3

Here you go, play with it yourself and get a feel for it.
http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html
>>
Anonymous 09/04/14(Thu)19:23 UTC+1 No.6735339 Report

>>6735335
>>6735331
Thanks
All the content on this website comes from 4chan.org. All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster. 4chanArchive is not affiliated with 4chan.