Download presentation
Presentation is loading. Please wait.
Published byMartin McKinney Modified over 6 years ago
1
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
Prisha Palpunavam Postgraduate Lab 2 FIST (PG LAB 2)
2
Let’s Learn Conversion
3
Decimal (Integer) to Binary Conversion
Operand – data to be operated on
4
Decimal (Fraction) to Binary Conversion
Operand – data to be operated on
5
Octal to Decimal Conversion
Operand – data to be operated on
6
Decimal to Octal Conversion
Operand – data to be operated on
7
Octal to Binary Conversion
Operand – data to be operated on
8
Binary to Octal Conversion
Operand – data to be operated on
9
Hexadecimal to Decimal Conversion
Operand – data to be operated on
10
Decimal to Hexadecimal Conversion
Operand – data to be operated on
11
Hexadecimal to Binary Conversion
Operand – data to be operated on
12
Binary Coded Decimal (BCD)
Decimal digits 0 through 9 is represented using binary code of 4 digits [ ] Operand – data to be operated on
13
Convert Decimal (Integer) to BCD
Question (137)10 Operand – data to be operated on
14
Convert Decimal (Integer) to NBCD
Question (137)10 Operand – data to be operated on
15
Natural Binary Coded Decimal (NBCD)
[ ], weight of each of the digits. MSB, most significant byte LSB, least significant byte NBCD is not similar to straight binary Operand – data to be operated on
16
Convert Decimal (Integer) to NBCD
Question (137)10 Operand – data to be operated on
17
Convert Decimal (Fraction) to NBCD
Question (456.75)10 Operand – data to be operated on
18
Convert Binary to NBCD Question (101011)2
Operand – data to be operated on
19
Convert NBCD to Binary Question (100101010011.10000010)NBCD
Operand – data to be operated on
20
Excess-3 code Adding 3 to each digit Operand – data to be operated on
21
Decimal to Excess-3 code
Example: ( )10 Operand – data to be operated on
22
Excess-3 code to Decimal
Example: ( )XS3 Operand – data to be operated on
23
LAB 6-DISCUSSION
24
1. Briefly explain the following representations: sign magnitude, twos complement, biased.
Operand – data to be operated on
25
Sign-Magnitude Representation
In an N-bit word, the left-most bit is the sign (0 = positive, 1 = negative) and the remaining N – 1 bits comprise the magnitude of the number. (Represent using 8 bits) Operand – data to be operated on
26
Twos Complement Representation
A positive integer is represented as in sign magnitude. A negative number is represented by taking the Boolean complement of each bit of the corresponding positive number, then adding 1 to the resulting bit pattern viewed as an unsigned integer.
27
Biased Representation
A fixed value, called the bias, is added to the integer. Uses a pre-specified number K as a biasing value. K = 2n-1 – 1 Examples 1: Given 4 bits, bias value, K = 23 –1 = 7 Add the bias = 10 Get unsigned value +10 Thus, 3 in 4-bit biased representation will be 1010. Final Answer: 1010. Operand – data to be operated on
28
4. What is the difference between the twos complement representation of a number and the twos complement of a number? Operand – data to be operated on
29
Twos complement representation of a number is the bit pattern used to represent an integer.
Twos complement of a number is the operation that computes the negation of a number in twos complement representation. Operand – data to be operated on
30
5. Assume number are represented in 8-bit twos complement representation. Show the calculation of the following: – – 13 – 6 – 13 Operand – data to be operated on
31
a. 6 + 13. [8 4 2 1]. + 6 0000 0110. +13 0000 1101 + ______________
a [ ] ______________ ______________ a [ ] (2’s Comp) ______________ Carry = 1 ______________ Operand – data to be operated on
32
a [ ] (2’s Comp) ______________ ______________ a [ ] (2’s Comp) (2’s Comp) ______________ Carry = 1 ______________ Operand – data to be operated on
33
Part 2: Microprocessor Programming Example: Calculate the sum of series of numbers. The length of the series is in memory location 4200H and the series begins from memory location 4201H. Consider the sum to be 8 bit number. So, ignore carries. Store the sum at memory location 4300H H = 04H 4201H = 01H 4202H = 02H 4203H = 03H 4204H = 04H Result = 01H + 02H + 03H + 04H = 0AH 4300H = 0AH Operand – data to be operated on
34
Assignment 2 Part 3: Exercises (3 marks) Find the largest number in a block of data. The length of the block is in memory location 2200H and the block itself starts from memory location 2201H. Store the maximum number in memory location 2300H. Assume that the numbers in the block are all 8 bit unsigned binary numbers. [Load in ANY 6 data] Instructions: Submit the report on 8th January 2018, in Lab or to my office. Frontpage Flowchart – 1 mark Assembly program – 2 marks Operand – data to be operated on
35
END OF LAB 3 & LAB 4 (Part 2)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.