3.1.1 · D4Boolean Algebra & Logic Gates

Exercises — Binary number system and bit - byte concepts

2,200 words10 min readBack to topic

Before we start, one reminder of the only two facts every problem below leans on:

The picture below is the mental ruler I want you to lay under every bit-string in this page.

Figure — Binary number system and bit - byte concepts

Level 1 — Recognition

Goal: can you read the notation and place the columns correctly?

Exercise 1.1. Write the place-value (weight) of each column for a 6-bit number, right to left.

Exercise 1.2. In the number , which single column contributes the largest amount, and how much is it?

Exercise 1.3. True or false: the byte pattern is a valid value. What decimal number is it?

Recall Solution 1.1

Columns from right (position ) to left (position ): Why start at ? Position is worth , and the rightmost position is , and .

Recall Solution 1.2

Line the weights under the bits: The leftmost bit is a sitting in the column, so it contributes — the largest single amount here. Why the leftmost, not just any ? The left column always has the highest weight (); a there beats every column to its right combined ().

Recall Solution 1.3

True — every bit off is still a legal pattern. It equals Why it counts: the parent note stresses that bits give patterns and they start at . The all-zero pattern is the number zero.


Level 2 — Application

Goal: run the two conversion methods cleanly, both directions.

Exercise 2.1. Convert to decimal.

Exercise 2.2. Convert to binary using repeated division by 2.

Exercise 2.3. How many distinct patterns does a nibble hold, and what is its largest unsigned value?

Recall Solution 2.1

Weights under the bits: Add only the columns with a (a contributes nothing):

Recall Solution 2.2
step divide quotient remainder (bit)
1
2
3
4
5
6

Read remainders bottom-up: . Verify with Tool A: . ✓

Recall Solution 2.3

A nibble is bits, so patterns. They run , so the largest unsigned value is . Why not ? patterns, but the count includes ; the top of the range is .


Level 3 — Analysis

Goal: reason about why the machinery behaves as it does, and spot flaws.

Exercise 3.1. Without full conversion, decide which is larger: or . Justify by column reasoning alone.

Exercise 3.2. A student claims " bits store numbers up to ." Show one concrete case where this fails and state the correct maximum.

Exercise 3.3. Explain why appending a to the right of any binary number doubles its value (e.g. ).

Recall Solution 3.1

Compare from the most significant (leftmost) bit — that column outweighs everything to its right.

  • : leftmost bit () is .
  • : leftmost bit () is also — tie, move right.
  • Next column (): has ; has . So wins here.

Since a single higher column () beats all lower columns combined (), . Check: . ✓

Recall Solution 3.2

Take . Patterns: — that is patterns, but the values are through . The claimed max is never reachable ( needs a 4th bit). Correct maximum: . Root cause: patterns start at , so the count is one more than the top value.

Recall Solution 3.3

Appending a on the right shifts every existing bit one column to the left, and each column is worth the one to its right. So every bit's contribution doubles, and the new rightmost column () holds a (adds nothing). Algebra view: if , shifting gives . This is binary's version of "add a zero to multiply decimal by 10."

The shift-by-one-column idea is worth seeing:

Figure — Binary number system and bit - byte concepts

Level 4 — Synthesis

Goal: chain multiple ideas — sizing, ranges, and cross-base thinking.

Exercise 4.1. How many bits are needed to store the decimal number as an unsigned integer? Show the reasoning, not just the answer.

Exercise 4.2. A byte is bits. Split the byte into its high nibble and low nibble, convert each nibble to decimal, then convert the whole byte to decimal. Confirm the relationship between them.

Exercise 4.3. Compare and . How many more bytes is one KiB than one kB, and what fraction extra is that?

Recall Solution 4.1

We need the smallest with , i.e. . So bits. (With bits the max is ; with bits the range is , which comfortably holds .) Why and not ? Because the top representable value is ; we need .

Recall Solution 4.2

Split the byte down the middle:

  • High nibble .
  • Low nibble .
  • Whole byte .

The relationship: the high nibble sits in the top four columns ( upward), so it is worth its own value: This is exactly why one nibble maps to one hex digit — see Hexadecimal number system.

Recall Solution 4.3
  • bytes (binary prefix, used for RAM/Memory addressing).
  • bytes (decimal SI prefix, used by disk makers).
  • Difference: bytes.
  • Extra fraction: more.

Why they differ at all: is a power of two (natural to binary addressing); is a power of ten (natural to human counting). They just happen to be close.


Level 5 — Mastery

Goal: open-ended, real-machine reasoning that fuses everything.

Exercise 5.1. A memory chip has addressable bytes. (a) How many bytes is that in KiB? (b) How many bits does an address need so that every byte has a unique address?

Exercise 5.2. You must store a scoreboard value that can reach . Choose the smallest number of whole bytes and state the resulting unsigned range. Would a 2-byte value overflow?

Exercise 5.3. Explain, using the pattern-count idea, why doubling the number of address bits does not double the number of addressable locations — it squares the multiplier. Give the exact factor.

Recall Solution 5.1

(a) bytes bytes . (b) To give each of bytes a unique address we need bits with , so bits. Exactly address lines address exactly bytes — a perfect fit, no waste. (See Memory addressing.)

Recall Solution 5.2
  • 2 bytes bits range to .
  • Since , 2 bytes suffice — no overflow.
  • (1 byte would only reach , hopelessly small; 3 bytes would be wasteful here.) Why check against , not ? Top value is ; itself is unreachable in bits.
Recall Solution 5.3

Locations addressable by bits . Go from to bits: So the count is multiplied by , not by . Concretely, bits address locations; bits address — a factor of , i.e. , not . Why: each extra bit doubles the count, and you added extra bits, so you doubled times .


Recall Final self-test (forecast, then reveal)

Which byte is larger, or ? ::: — first difference is at (bit vs ); it equals vs . Smallest bit-count for ? ::: , so bits. in bytes? ::: bytes.

Connections