JellyPages.com

Sunday, 21 October 2012

ARITHMETICS FOR COMPUTERS (NUMBER SYSTEM & OPERATIONS)


Introduction 


Number System Base.
Table : Number System Conversion

Binary ( X2 )


Decimal ( X10 )

Hexadecimal ( X16 )
0000
0
0
0001
1
1
0010
2
2
0011
3
3
0100
4
4
0101
5
5
0110
6
6
0111
7
7
1000
8
8
1001
9
9
1010
10
A
1011
11
B
1100
12
C
1101
13
D
1110
14
E
1111
15
F
10000
16
10

REMEMBER THIS!!

210
29
28
27
26
25
24
23
22
21
20
1024
512
296
128
64
32
16
8
4
2
1

20
2-1
2-2
2-3
2-4
2-5
1
0.5
0.25
0.125
0.0625
0.03125


Conversion of Decimal to Binary.
Conversion of Binary to Decimal.


Conversion of Decimal point to Binary


Conversion of Hexadecimal to Binary

Conversion of Binary to Hexadecimal

Sign Integer Representation
~ represent negative (-ve) values, computer system allocate the high order bit to indicate the sign of value.
~ 0 (+ve sign) ; 1 (-ve sign)
high order bit :
- left most in a byte .   called the most significant bit.
- remaining bits contain the value of the number.
3 ways signed binary numbers been expressed:
-          signed magnitude
-          1’s complement
-          2’s complement

Negative Number Conversion


Second complement





Binary Addition
The binary number operation rules (addition)

Binary Rules


Sum

Carry
0 + 0 = 0
0
0
0 + 1 = 1
1
0
1 + 0  =  1
1
0
1 + 1 = 1
0
1


 Binary Subtraction

The binary number operation rules (subtraction)

Binary Rules


Sum

Borrow
0 – 0 = 0
0
0
0 – 1 = 1
1
10
1 – 0 = 1
1
0
1 – 1 = 1
0
1
 



Binary Multiplication
The binary number operation rules (multiplication)

Binary Rules

Multiply

0 x 0 = 0
0
0 x 1 = 1
0
1 x 0 = 1
0
1 x 1 = 1
1

Hexadecimal  Addition
If sum number  >  1510, the amount of the sum that exceeds 1610 will carry a 1 to 
the next column.

Hexadecimal  Subtraction
 1st step :  convert the hexadecimal number to binary number
2nd step : take the 2nd complement of the binary number and change it back to hexadecimal number
3rd step : add both numbers to get the result




Post by Nurul Syifa Binti Zainudin (B031210018)

DIGITAL LOGIC


Login design.
·           Digital electronics operate with only two voltage levels
-          high voltage and a low voltage
·           Computer used binary system (1,0)
·           Combinational logic block contains no memory
·           Logic block with n inputs, there are 2nd entries (possibility) in the truth table.


Boolean algebra.
  • P1: X = 0 or X = 1
  • P2: 0 . 0 = 0 
  • P3: 1 + 1 = 1 
  • P4: 0 + 0 = 0 
  • P5: 1 . 1 = 1 
  • P6: 1 . 0 = 0 . 1 = 0 
  • P7: 1 + 0 = 0 + 1 = 1

Laws of Boolean algebra.





Example.




Basic Logic Gates.







Boolean Equation Forms.

Sum-of-product (SOP)
-          Combination of input values that produce 1s is convert into equivalent variables, ANDed together then ORed with other combination variables with same output.
-          SOP is easier to derive from truth table.
Example:
F = ABC + (ABC)’
The truth table:
A
B
C
ABC
(ABC)’
F
0
0
0
0
1
1
0
0
1
0
1
1
0
1
0
0
1
1
0
1
1
0
1
1
1
0
0
0
1
1
1
0
1
0
1
1
1
1
0
0
1
1
1
1
1
1
0
1
SOP expression:
F = ABC + (ABC)’

Product-of-sums (POS)
-          Input combinations that produce 0 in sums terms (ORed variables) are ANDed together.
-          Convert input values that produce 0s into equivalent variables, ORed the variables, then ANDed with other ORed.
-          Usually are if more 1s produce in output function.

Example:
F = (A + B + C)(A + B + C’)(A + B’ + C)(A’ + B + C)

A
B
C
F
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
1
1
1
1
1
POS expression:
F = (A + B + C)(A + B + C’)(A + B’ + C)(A’ + B + C)

Post by Marissa Aefdiani Effendi (B031210235)