Reference no: EM132485065
Assignment Questions -
QUESTION 1 -
(a) Represent the fixed point decimal number + 120.875 in IEEE 754 floating point format. Express your final answer in hexadecimal showing all the working.
(b) Consider a hypothetical floating point format which is similar to IEEE format except that it uses 6 bit excess-31 notation for the exponent and 25 bits for the mantissa in a 32 bit machine. Represent the decimal number from part (a) in hexadecimal using this hypothetical format. Show all the working.
QUESTION 2 -
Given a very small binary number 0.00001100011, represent this number in IEEE 754 floating point format. Express your final answer in hexadecimal showing all the working.
QUESTION 3 -
The hexadecimal number C2618000 represents a decimal number using IEEE 754 floating point format. What decimal number does this represent?
QUESTION 4 -
1. Type the following program as covered in Lecture 3 (slide 23) using the appropriate mnemonics. Run the program using the given LMC executable in the Step by Step mode. Describe in words what you see when you execute the LMC program in this mode.
Mailbox
|
Code
|
Instruction Description
|
00
|
901
|
input 1st Number
|
01
|
399
|
store data
|
02
|
901
|
input 2nd Number
|
03
|
199
|
add 1st Number to 2nd Number
|
04
|
902
|
output result
|
05
|
000
|
stop
|
99
|
000
|
data
|
QUESTION 5 -
Type the following program as covered in Lecture 4 (slide 33). Run the program using the LMC executable in the Step by Step mode. Describe in words what you see when you execute the LMC program in this mode.
00
|
IN
|
901
|
input first number
|
01
|
STO 10
|
310
|
save in box 10
|
02
|
IN
|
901
|
input second number
|
03
|
STO 11
|
311
|
save in box 11
|
04
|
SUB 10
|
210
|
result = second - first
|
05
|
BRP 08
|
808
|
if result < 0 then
|
06
|
LDA 10
|
510
|
negative
|
07
|
SUB 11
|
211
|
result = first - second
|
08
|
OUT
|
902
|
output result
|
09
|
HLT
|
000
|
stop
|
10
|
DAT 00
|
000
|
first number
|
11
|
DAT 00
|
000
|
second number
|
QUESTION 6 -
The following Little Monkey Computer program is supposed to add two input numbers, subtract third input number from the sum, and output the result., i.e.,
OUT = IN1 + IN2 - IN3
Mailbox
|
Mnemonic Code
|
Numeric Code
|
00
|
IN
|
901
|
01
|
STO99
|
399
|
02
|
IN
|
901
|
03
|
ADD99
|
199
|
04
|
STO99
|
399
|
05
|
IN
|
901
|
06
|
SUB99
|
299
|
07
|
OUT
|
902
|
08
|
HLT
|
000
|
(i) Enter the above program as given. Is the output what you had expected?
(ii) What is wrong with this program?
(iii) Modify the program so that it produces the correct result.
(iv) Verify your modified program using the LMC executable.
QUESTION 7 -
The steps that the Little Monkey in our LMC model performs are closely related to the way in which the CPU actually executes instructions in a real computer.
Draw a flowchart that carefully describes the steps that the Little Monkey follows to execute a branch instruction.
Note: Include all the program files in your submission.