Computer Organization With Assembly Language
Computer Organization With Assembly Language
Computer Organization With Assembly Language
5
BINARY NUMBER SYSTEM
Binary numbers are base 2 numbers in which each binary
digit is either a 0 or a 1.Each digit has a weighted value
of 20 , 21, 22, 23, and so on.
Binary integer can be signed(may be +ve or -ve)or
unsigned(only +ve)
Bit on the left is called the most significant bit (MSB)
Example:
00001010 = decimal 10
10001010 = decimal -10
7
HEXADECIMAL NUMBER SYSTEM
8
CONVERSION BETWEEN NUMBER
SYSTEM
hexadecimal to decimal
Binary to decimal
Decimal to binary
Decimal to hexadecimal
Hexadecimal to binary
Binary to hexadecimal
CONVERTING HEXADECIMAL TO
DECIMAL
10
CONVERTING BINARY TO DECIMAL
Multiply each digit of the binary number from right to
left with its corresponding power of 2.
Convert the Binary number 11101 to decimal number.
11
CONVERTING DECIMAL TO BINARY
12
CONVERTING DECIMAL TO
HEXADECIMAL
Divide the decimal number by 16.
Take the remainder and record it on the side.
13
CONVERTING HEXADECIMAL TO
BINARY
11001 647
+ 10011 + 537
101100 1184
16
BINARY ARITHMETIC OPERATIONS
Subtraction
Two numbers can be subtracted by subtracting each pair of
digits together with borrowing, where needed.
11001 627
- 10011 - 537
00110 090
17
HEXADECIMAL ARITHMETIC
OPERATIONS
Addition
Like decimal numbers, two numbers can be added by
adding each pair of digits together with carry
propagation.
5B39
+ 7AF4
D62D
Hexadecimal Addition
18
HEXADECIMAL ARITHMETIC
OPERATIONS
Subtraction
Two numbers can be subtracted by subtracting each pair of
digits together with borrowing, where needed.
D26F
- BA94
17DB
Hexadecimal Subtraction
19
ONE’S COMPLEMENT
The one’s complement of an integer is obtained by
complementing each bit, that is, replace each 0 by a 1
and each 1 by a 0.
20
2’S COMPLEMENT
Negative integers are stored in computer using 2’s
complement.
To get a two’s complement by first finding the one’s
complement, and then by adding 1 to it.
Example
11110011 (one's complement of 12)
+ 00000001 (decimal 1)
11110100 (two's complement of 12)
21