Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Computer Organization With Assembly Language

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 21

COMPUTER ORGANIZATION

WITH ASSEMBLY LANGUAGE


Lecture: 03
LECTURE OUTLINE
 Data Representation
 Binary
 Octal
 Decimal
 Hexadecimal
NUMBER SYSTEM
 Any number system using a range of digits that
represents a specific number. The most common
numbering systems are decimal, binary, octal, and
hexadecimal.
 Numbers are important to computers
 represent information precisely
 can be processed
DECIMAL NUMBER SYSTEM

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)

 Bit on the right is called least significant bit(LSB)


SIGNED INTEGERS

 A signed integer can be positive or negative.


 The most significant bit is reserved for the sign:
 1 means negative and 0 means positive.

 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

 Multiply each digit of the hexadecimal number from right to


left with its corresponding power of 16.
 Convert the Hexadecimal number 82AD to decimal number.

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

 Divide the decimal number by 2.


 Take the remainder and record it on the side.

 REPEAT UNTIL the decimal number cannot be


divided into anymore.

12
CONVERTING DECIMAL TO
HEXADECIMAL
 Divide the decimal number by 16.
 Take the remainder and record it on the side.

 REPEAT UNTIL the decimal number cannot be


divided into anymore.

13
CONVERTING HEXADECIMAL TO
BINARY

 Given a hexadecimal number, simply convert each digit


to it’s binary equivalent. Then, combine each 4 bit binary
number and that is the resulting answer.
CONVERTING BINARY TO
HEXADECIMAL

 Begin at the rightmost 4 bits. If there are not 4 bits, pad


0s to the left until you hit 4. Repeat the steps until all
groups have been converted.
BINARY ARITHMETIC OPERATIONS
 Addition
 Like decimal numbers, two numbers can be added by
adding each pair of digits together with carry
propagation.

11001 647
+ 10011 + 537
101100 1184

Binary Addition Decimal Addition

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

Binary Subtraction Decimal Subtraction

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

You might also like