Binary and Decimal Numbers
Binary and Decimal Numbers
yrosenthal.com/ppt/binary/Binary_and_Decimal_Numbers_feb0605.ppt
Another name for decimal numbers are base-10 (pronounced "base ten") numbers.
When you see a number that consists of only ones and zeroes, you must be told if it is a binary number or a decimal number.
(Well see later how text and pictures can be converted into simple numbers for now just take our word for it.) Therefore, if we can derive a way to store and retrieve numbers electronically this method can be used by computers to store and retieve any type of information.
Binary Numbers are at the heart of how a computer stores all information
Computers Store ALL information using Binary Numbers Computers use binary numbers in different ways to store different types of information.
10
11
Some Terminology
The following are some terms that are used in the computer field
Each digit of a binary number is called a bit. A binary number with eight bits (i.e. digits) is called a byte.
12
13
14
For n bits there are 2n different binary numbers: # of bits 1 bit: 2 bits: 3 bits: 4 bits: 5 bits: 6 bits: 7 bits: 8 bits: 9 bits: 10 bits: etc. # of different binary numbers 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 26 = 64 27 = 128 28 = 256 29 = 512 210 = 1024
15
16
17
18
Largest numbers
The following are the largest values for binary numbers with a specific number of bits:
# of bits value 1 bit: 2 bits: 3 bits: 4 bits: 5 bits: 6 bits: 7 bits: 8 bits: etc. largest binary # 1 11 111 1111 11111 111111 1111111 11111111 1 3 7 15 31 63 127 255 decimal
19
Example 2: To convert the decimal number 106 to binary, you will need at least 7 bits. (With 6 bits you can only store numbers up to 63 but with 7 bits you can store numbers up to 127)
20