QUIZQuiz · #6EP.98 · 24 s

Quiz #6: What is 0x20 in decimal?

// WHAT YOU WILL LEARN

What is 0x20 in decimal? (32)

// LESSON NOTES

Quick quiz! What is 0x20 in normal (decimal) numbers? 🤔
A) 20 B) 32 C) 16 D) 200

Comment your answer before the reveal! 👇

✅ Answer: B — 32!

1️⃣ HEX PLACE VALUES: in hex (base 16) the right digit counts ones, the left digit counts sixteens. Digits go 0–9, then A–F (A = 10 … F = 15).

2️⃣ THE MATH: 0x20 = 2 × 16 + 0 × 1 = 32.

3️⃣ IN BINARY: 32 = 0b0010 0000 — just one bit on: bit 5. On an Arduino Uno, PORTB = 0x20 turns on pin 13's LED. (Fun fact: 0x20 is also the code for a space character.)

0x20 is 32!

Read the voiceover (transcript)
  1. What is hex two zero in decimal?
  2. Twenty, thirty-two, sixteen, or two hundred? Comment your answer!
  3. It's B, thirty-two! In hex, the left digit counts sixteens.
  4. Two sixteens plus zero ones is thirty-two. In binary, that's just bit five!
  5. Hex two zero is thirty-two!
  6. Next quiz: which wire is earth? Follow for more!

Related lessons