Lecture 27 Binary Basics

In mathematics and digital electronics, a binary number is a number expressed in the base-2 numeral system or binary numeral system, which uses only two symbols: typically 0 (zero) and 1 (one).

Base 10 counting system:
We happened to use the current counting system, because we happened to have ten fingers.
If dinosaurs had ruled the earth, they would be happy to use a 8-based counting system..

What does 157 mean? 157 = 1 x 100 + 5 x 10 + 7 x 1 = 1 x 10^2 + 5 x 10
^1 + 7 x 10^0

Imagine a specie that only has two fingers. how can they count? A computer is such kind of two-finger specie. 0 and 1 Each place is the exponential of 2.

Base 10: 157: 157 =
1 x 10^2 + 5 x 10^1 + 7 x 10^0
Base 2: 1011 = 1 x 2^3 + 0 x 2^2 + 1 x 2^1 + 1 x 2^0

1 bit is a single bit of information, a 1 or 0. Only two possible values.
1 byte is 8 bits, an 8 bit word
256 possible values from 0-255 base 10 or 00000000 to 11111111 base 2
10100110 is a single byte

Base 10 to Binary

Binary mathematics

Binary code is too long in representation. Hex is much shorter. Converting a binary number to a Hex number is relatively easy. Every 4 bit can convert to a Hex.
Problem: we are short of numbers A-10 B-11 C-12 D-13 E-14 F-15

Lookup table:

Example: