cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1587
Views
0
Helpful
2
Replies

Im confused power of 2 bits vs bit placements.

dolanduck.
Level 1
Level 1

for example there are 8 bits per segment thing if you add them all up but in the the power of 2 there are only 7 why ?

2 Replies 2

ChristianF.
Level 1
Level 1

Remember that 0 is a number as well.

 

Think matrices/arrays in programming, which starts with index 0 in most languages. Making index 7 the eighth value in the list.

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @dolanduck.  

be aware that 2^0 = 1 actually every number  N^0 = 1 so the rightmost position in an octet/byte is 1 and that 1 allows to represent odd numbers otherwise how you could represent a number like 129 ?

 

129 = 10000001   in binary   = 2^7 + 2^0 = 128 + 1

 

Hope to help

Giuseppe

 

Review Cisco Networking for a $25 gift card