Menu
Coddy logo textTech

Powers of Two

Lesson 3 of 46 in Coddy's IP Addressing and Subnetting course.

Subnetting keeps asking one question: how many combinations do n bits give? The answer is always a power of two. One bit gives 2 values, two bits give 4, three give 8, and each extra bit doubles the count.

The eight place values of a byte are exactly the powers 27 down to 20: 128 64 32 16 8 4 2 1. Say them until they feel like a phone number you know by heart. Every mask, block size, and host count in this course comes from this row.

challenge icon

Challenge

Beginner

Print the eight place values of a byte, highest first, on a single line separated by single spaces.

Expected output:

128 64 32 16 8 4 2 1

Try it yourself

Terminal

All lessons in IP Addressing and Subnetting

Practice on your own: Terminal playground