CS001x_MyCS: Computer Science for Beginners (Summary)

Page 28

2015

Ibrahim Omar CS

Computers tend to store numbers in sets of eight bits, called a byte, which can represent any decimal value from 0 to 255 (256 patterns). Binary Counting with Dots: YouTube.com/watch?v=b6vHZ95XDwU For each bit that we add, we double the range of numbers:          

1 bit = 2 patterns (0 - 1) 2 bits = 4 patterns (0 - 3) 3 bits = 8 patterns (0 - 7) 4 bits = 16 patterns (0 - 15) 5 bits = 32 patterns (0 - 31) 6 bits = 64 patterns (0 - 63) 7 bits = 128 patterns (0 - 127) 8 bits = 256 patterns (0 - 255) 9 bits = 512 patterns (0 - 511) 10 bits = 1024 patterns (0 - 1023)

With ten bits, you can count up to 1023. That's why computer scientists think that 1024 is a nice, round number. In fact, on a computer, one k is 1024 patterns (0 - 1023) not 1000.

You can count on binary on your hand. Each finger either up (1) or down (0). So you can count from (0 - 31) on one hand and with two hands, you can count to 1023.

(24)


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.