EEE 211 Lecture 2
EEE 211 Lecture 2
EEE211
Lecture 2
Dr Atiqur Rahman
Dept. of Electrical and Computer Engineering
North South University
Binary Arithmetic
Complements
Example:
Example:
Signed-magnitude representation:
The number consists of magnitude and sign bit
8-bit binary signed magnitude representation of +(9)10 is
(00001001 )2 and (-9)10 is (10001001 )2
The right bit of the result is placed under the column of bits. The left
bit is called the "carry out of the column".
1 1 1 1 0 0 0 0
0 0 1 1 1 0 1 0 1 0 1 0
0 1 0 1 1 1 0 0 1 1 0 0
--- --- --- --- --- --- --- --- --- --- --- ---
0 01 01 10 11 10 10 01 10 01 01 00
+6 00000110
+13 00001101
--------- ------------------
+19 00010011
Binary Number Subtraction
Similar to decimal system using borrowing:
Subtract one binary number from another by using the
standard techniques adapted for decimal numbers
(subtraction of each bit pair, right to left, "borrowing"
as needed from bits to the left).
Example:
4 9
0100 1001 = 01001001BCD
Similarly,
(185)10 = ( 0001 1000 0101)BCD = (10111001)2
21
Error Detecting Code - Parity Coding