Converting between base 10 and 2
BASE 10
263
100 X 2
+
10 X 6
+
1 X 3
BASE 2
101
1 X 1
+
2 X 0
+
4 X 1 = 5
another example
11011
1 X 1
+
2 X 0
+
4 X 1
+
8 X 1 = 27
8Bit size = Byte
1 2 3 4 5 6 7 8
_________________________________________________________
| 128's | 64's | 32's | 16's | 8's | 4's | 2's | 1's |
|________|______|______|______|_____|_____|_____|_____|
| 1 1 1 1 1 1 1 1 = 255 in UTF8 is ÿ
|______________________________________________________
_________________________________________________________
| 128's | 64's | 32's | 16's | 8's | 4's | 2's | 1's |
|________|______|______|______|_____|_____|_____|_____|
| 0 1 1 1 1 1 1 1 = 127 in ASCII is DEL
|______________________________________________________
_________________________________________________________
| 128's | 64's | 32's | 16's | 8's | 4's | 2's | 1's |
|________|______|______|______|_____|_____|_____|_____|
| 0 1 1 1 0 1 1 1 = 119 in ASCII is w
|______________________________________________________
_________________________________________________________
| 128's | 64's | 32's | 16's | 8's | 4's | 2's | 1's |
|________|______|______|______|_____|_____|_____|_____|
| 0 1 1 0 0 0 1 1 = 99 in ASCII is c
|______________________________________________________
16bit encoding came out later.
32bit & 64bit are the standard today.
TAKE NOTE
This is just like in decimal count
The number 1,654 is:
__________________________________
| 1000's | 100's | 10's | 1's |
|_________|________|______|_____|
| 1 6 5 4
|_________________________________
A number at each place is just a multiplacation of 10.
Representing floating numbers:
A floating number, lets say 625.9 can be represented in the following way
0.6259 * 10^3
|___| ^
| | exponent
Segnificant
Floating numbers are represented in a 32bit number storage.
______________________________________________________________________________________________________________________________________________________________
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
|__||_______________________________||______________________________________________________________________________________________________________________|
^ ^ ^
| | |
sign exponent Segnificant
(-/+) 8bits 23bits
1bit
The ALU - An arithmetic logic unit (ALU) is a combinational digital electronic circuit that performs arithmetic and bitwise operations on integer binary numbers.
This is in contrast to a floating-point unit (FPU), which operates on floating point numbers.
An ALU is a fundamental building block of many types of computing circuits, including the central processing unit (CPU) of computers, FPUs, and graphics processing units (GPUs).
single CPU, FPU or GPU may contain multiple ALUs.
The inputs to an ALU are the data to be operated on, called operands, and a code indicating the operation to be performed; the ALU's output is the result of the performed operation. In many designs, the ALU also has status inputs or outputs, or both, which convey information about a previous operation or the current operation, respectively, between the ALU and external status registers.
Arithmetic unit
Bitwise logical operations unit