How can a computer display eight bits using just two characters?
You’re checking a sensor reading at a school weather station. One screen shows eight bits. Another shows just two characters for the same reading. How can both screens be right?
Here’s the reading in binary. You already know each bit is zero or one, and each position has twice the value of the position to its right. These eight bits together make one byte.
Draw a line halfway through the byte. You get zero zero one zero on the left and one one zero one on the right. Each four-bit group is called a nibble.
Look at the new byte on screen. You need two groups with the same number of bits. Keep the bits in their original order and pick the split that gives two nibbles.
Four bits give you sixteen possible patterns, from zero to fifteen in decimal. Hexadecimal, or hex, gives each pattern one digit. Read down the table: zero to nine stay the same, then A, B, C, D, E and F stand for ten through fifteen.
Split the byte into zero zero one zero and one one zero one. The first gives two. The second gives eight plus four plus one, thirteen, written D. Join them: two D, base sixteen. Two sixteens plus thirteen ones gives forty-five. The binary weights, thirty-two, eight, four and one, also give forty-five.
Convert the binary byte on screen to hexadecimal. Split it into two nibbles and work out the value of each. Then pick the base sixteen answer that gives the correct digits in the same order.
To reverse the conversion, read one hex digit at a time. Two uses the two-place, so write zero zero one zero. D is thirteen, so write one one zero one. Join the two groups to get the original byte, and label it base two.
Start with D two in hex. D gives one one zero one. If you write two as just one zero, D’s bits land in lower places and the result is fifty-four in decimal. Keep both zeros at the start of the second nibble. Now you get the correct value, two hundred and ten.
If the exam asks you to convert three B from hexadecimal to binary and show your working, write zero zero one one for three, then one zero one one for B. Join the nibbles and write a small two at the lower right to label the answer as binary.