Which 8-bit binary sequence represents decimal 32?

Enhance your programming skills with the RECF Programming Test. Features flashcards and multiple choice questions with hints and explanations. Prepare for success!

Multiple Choice

Which 8-bit binary sequence represents decimal 32?

Explanation:
In eight-bit binary, each bit represents a power of two, from 2^7 on the left to 2^0 on the right. To represent decimal 32, you need the bit for 2^5 to be 1 and all other bits 0. That gives 00100000. The pattern with 1 in the 2^4 position equals 16 (00010000), and the pattern with 1 in the 2^6 position equals 64 (01000000). The short sequence 0010000 isn’t eight bits long, so it isn’t the proper 8-bit representation. So the correct form is the one with the 1 in the 32’s place.

In eight-bit binary, each bit represents a power of two, from 2^7 on the left to 2^0 on the right. To represent decimal 32, you need the bit for 2^5 to be 1 and all other bits 0. That gives 00100000. The pattern with 1 in the 2^4 position equals 16 (00010000), and the pattern with 1 in the 2^6 position equals 64 (01000000). The short sequence 0010000 isn’t eight bits long, so it isn’t the proper 8-bit representation. So the correct form is the one with the 1 in the 32’s place.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy