Which is the binary representation of decimal 4?

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 is the binary representation of decimal 4?

Explanation:
Binary numbers represent quantities as sums of powers of two, with each bit indicating whether that power is present. In a four-bit representation the positions correspond to 2^3, 2^2, 2^1, and 2^0 from left to right. To get decimal 4, you put a 1 in the 2^2 position and 0 in the others, which yields 0100. In other words, the 4’s place is filled while the higher and lower places are empty. The other patterns would correspond to 2, 8, or 1, respectively, not 4.

Binary numbers represent quantities as sums of powers of two, with each bit indicating whether that power is present. In a four-bit representation the positions correspond to 2^3, 2^2, 2^1, and 2^0 from left to right. To get decimal 4, you put a 1 in the 2^2 position and 0 in the others, which yields 0100. In other words, the 4’s place is filled while the higher and lower places are empty. The other patterns would correspond to 2, 8, or 1, respectively, not 4.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy