Binary Numbers

The number system we use is the decimal number system.  It is based on tens, meaning each place value is 10x the last place value.

Start on the right with one.
The next place value to the left is 10 x 1 or ten.
The place value after that is 10 x 10  or 100.
After that comes 10 x 100 or 1000, and so forth.
This can be represented by exponents:
103   102   101   100         or    1000   100   10  1

In different number systems we do the same thing, only the base number changes.
In the binary number system, the base value is two:
23   22   21   20           or       8  4   2   1
Each place value to the left is 2 x the one on its right.

In the hexadecimal number system, the base value is sixteen:   
163   162   161   160           or       4096    256   16    1
Each place value to the left is 16 x the one on its right.

To change from binary to decimal, add up the place values.  For example:
To change 10110011 in binary to a decimal number, we first have to figure out what the place values represent: 128   64  32   16   8   4   2  1.
So we have one 128, no 64, one 32, one 16, no 8 or 4, one 2 and one 1.
Add up what we have: 128+32 +16+2+1 = 179.
Therefore, 10110011 equals 179 in decimal.

The binary number 01100110 = 64 + 32+ 4 + 2 or 102 in decimal.

The binary number 10011001 = 128 + 16 + 8 + 1 = 153 in decimal.

To change from decimal to binary, we do the reverse process.  For example:

The decimal number 75 has one 64, no 32, no 16, one 8, no 4, one 2, one 1
or 1001011 in binary.

Four binary digits (or bits) are called a nibble.  A nibble can be equal to 0 through 15 in decimal numbers: 00002  through 11112.  
Eight bits are called a byte. A byte can represent up to 256 characters or symbols
(0 through 255 in decimal numbers): 00000000 through 111111112
(111111112 = 128+64+32+16+8+4+2+1 = 25510).

Computers use binary numbers, but binary numbers are difficult for humans to work with.  So we use hexadecimal numbers instead.  One hex digit can represent one nibble. 
Decimal 0 – 15 is the same as a nibble:  0000 – 11112, or one hex digit: 0 – F.

Note: A nibble will never be equal to more than decimal 15!

To change from hexadecimal to decimal, we follow the same procedure as we did with binary numbers. Step one: figure out what the place value represents in decimal.
For example, the hexadecimal number 4A equals 4 sixteens and A (or  10) ones.
The hexadecimal number 4A = (4 x 16 ) + (10 x 1) = 64 + 10 = 74 in decimal.
The hexadecimal number 7 3 = (7 x 16) + (3 x 1) = 112 + 3 = 115 in decimal.
The hexadecimal number 131 = (1 x 256) + (3 x 16) + (1 x 1) = 256 + 48 + 1 = 305 in decimal.

And to change from decimal to hexadecimal we do the reverse.
347 in decimal has one 256, five 16, and 11 ones.  So 34710 = 15B16.
85 in decimal = 55 in hexadecimal  {(5 x 16) + (5 x 1) = 80 + 5 = 85}.

Logic Gates

The AND gate is represented by the following truth table:

T and T = T
T and F = F
F and T = F
F and F = F

The OR gate is represented by the following truth table:

T or T = T
T or F = T
F or T = T
F or F = F

lmayer@elgin.edu