Unsigned Binary

The questions below are due on Sunday September 20, 2026; 11:59:00 PM.
 
You are not logged in.

Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
Back to Exercises

Unsigned Binary Representation

Binary to decimal

What is the decimal equivalent of the binary number 0b010000?

What is the decimal equivalent of the binary number 0b001100?

What is the decimal equivalent of the binary number 0b010100?

What is the decimal equivalent of the binary number 0b00010100?

Decimal to Unsigned Binary

Write 5 as a 4-bit binary number: 0b

Write the number 19 as a 6-bit unsigned binary number: 0b

Write the number 27 as an 8-bit unsigned binary number: 0b

Width of unsigned binary numbers

Can the number 17 be represented as a 4-bit unsigned binary number?

What is the smallest base-10 (decimal) number that can be represented using 4 bits of unsigned binary?

What is the largest base-10 (decimal) that can be represented using 5 bits of unsigned binary?

Unsigned Binary Arithmetic

What is the 4-bit result of adding 0b0110 + 0b0010? 0b

What is the smallest number of bits required to properly represent the result of adding 0b110 + 0b011?

What is the 5-bit result of 0b01100 - 0b00011? 0b

What is the smallest number of bits required to represent the result of multiplying 0b100 * 0b011?

What is the largest number of bits required to represent the result of multiplying two 5 bit numbers together?

What is the 6-bit result of multiplying 0b111 * 0b100? 0b

Bitwise Binary Operators: OR (|), AND (&), NOT (~), XOR (^), Left shift (<<), Right shift (>>)

For the following exercises assume that your bitwise operators take one or two numbers of equal width and perform operations on each of the bits producing a result of equal width. We will learn about what happens when the inputs are not of equal lengths next week.

What is the result of the following bitwise binary operations assuming all numbers are unsigned? Note that the only bitwise binary operator whose behavior depends on whether the number is signed or unsigned is the right shift operator. This will be covered in next week's two's complement exercise.

0b00011000
|
0b00101010 = 0b

0b11010000
&
0b10101010 = 0b

0b00110000
^
0b10101010 = 0b

~0b110010 = 0b

0b001010 << 2 = 0b

0b110010 >> 2 = 0b

Logical Binary Operators: Comparison (==, !=, <, <=, > >=), Logical AND (&&) , Logical OR (||), Logical NOT (!)

Logical operators take two numbers and produce a 0 (to indicate false) or 1 (to indicate true) output.

What is the result of the following logical comparisons assuming all values are unsigned?

0b0010 * 0b0011 != 0b0101?

0b0100 - 0b0011 > 0b010?

0b0101 + 0b0100 >= 0b1001

What is the result of the following logical binary operations?

0b00100 && 0b00011 =

(0b0010 - 0b0001 - 0b0001) && 0b0101 =

(0b101010 || 0b000000) =

!0b101010

Back to Exercises