Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A car park barrier counts the cars that pass through it in one year, in a 16-bit register. On one day the count reaches 2026.
Binary is base 2. The 8-bit place values are 128, 64, 32, 16, 8, 4, 2 and 1, and 16 bits go on to 256, 512 and so on up to 32768. Binary to denary: add the place values under the 1s. Denary to binary: take away the largest place values that fit, or divide by 2 again and again and read the remainders from the bottom up.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
Given. 2026 in a 16-bit register.
Plan. Take away place values, starting from the largest that fits.
Step 1. 2048 is too big, so the largest place value that fits is 1024. .
Step 2. , then , then .
Step 3. , then . 16 does not fit. . 4 does not fit. . 1 does not fit.
Step 4. Write the bits. The 1s are under 1024, 512, 256, 128, 64, 32, 8 and 2. In 16 bits: 0000011111101010.
Step 5. The largest count. All sixteen bits set to 1 give .
Step 6. Eight bits. 8 bits hold at most 255. 2026 is much larger, so the count would overflow.
Check. .
Answer: (a) 0000011111101010. (b) 65535. (c) No: 8 bits can hold only 0 to 255.
Log in to join the discussion.
Loading…