Binary to Decimal
Lesson 2 of 46 in Coddy's IP Addressing and Subnetting course.
Reading binary is the same trick in reverse: add up the place values under every 1.
Take 11000000. The two switched-on positions are worth 128 and 64, so the number is 128 + 64 = 192. That exact byte opens countless subnet masks, which is why it is worth recognizing on sight.
A handy shortcut: when the ones are all packed to the left, the values are always the same familiar sums: 10000000 is 128, 11000000 is 192, 11100000 is 224, 11110000 is 240, and so on up to 255.
Challenge
BeginnerConvert these two bytes to decimal and print each result on its own line, in this order:
1100000000001010
Expected output:
192
10Try it yourself
All lessons in IP Addressing and Subnetting
10Capstone - The Office
The Floor PlanSizing Each TeamCarving the BlockThe Router's ViewRecap - Ship the PlanPractice on your own: Terminal playground