IFN503 Assessment 2 - Deliverable 1: Number Systems, IEEE 754, and LMC

Verified

Added on  2022/11/25

|3
|607
|108
Homework Assignment
AI Summary
This document presents the solutions for IFN503 Assessment 2, a computer science assignment. Question 1 provides the ASCII representations of a character string in hexadecimal, binary, octal, and decimal. Question 2 addresses the representation of a fixed-point decimal number in IEEE 754 floating-point format, including hexadecimal conversion, along with a hypothetical floating-point format and its conversion. The question also involves converting a hexadecimal number back to its decimal equivalent using the IEEE 754 format. Question 3 requires the development of a Little Man Computer (LMC) program using symbolic addressing to output the sums of odd numbers from 1 to 15, demonstrating the use of LMC concepts and providing the LMC program code. The document includes detailed workings for each question.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
IFN503: Assessment 2 – Deliverable 1
Due Date: 11:59pm Sunday 8th September 2019 (Week 7)
Submission: Online via Blackboard
Weighting: 20%; Total Marks: 60; Individual
Instructions on how to present your answers.
1. Include the actual question and give your answers below each part of the
question, including all the working for each part of the question.
2. Any plagiarism on the actual question would be ignored.
Question 1 (10 marks)
What is the ASCII representation for the character string +15.3682 in the following
number systems:
(a) Hexadecimal : 31 35 2e 33 36 38 32
(b) Binary
00110001 00110101 00101110 00110011 00110110 00111000 00110010
(c) Octal 611 522 706 315 434 062
(d) Decimal 13850746402781234
Question 2 (20 marks)
(a) Represent the fixed point decimal number + 78.875 in IEEE 754 floating
point format. Express your final answer in hexadecimal showing all the
working.
(10 marks)
Sign bit 31- 0
78 in binary is 0100 1110
.875 in binary is
.875 x 2 = 1.750
.750 x 2 = 1.500
.500 x 2 = 1.000
S0 .875 in binary = 111
Complete number is 0100 1110.111
This gives exponent = 127 + 6 = 133
Mantissa = 00111011100000000000000
Together in hex: 0x429dc000
(b) Consider a hypothetical floating point format which is similar to IEEE 754
format except that it uses 6 bit excess-31 notation for the exponent, and 25 bits
1
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
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.
(4 Marks)
Sign bit = 0
78 in binary = 0100 1110
.875 in binary 111
Exponent is 31 + 6 = 37 = 100101
Mantissa = 0011101110000000000000000
Final representation 01001010011101110000000000000000
In hex 0x94EE 0000
(c) The hexadecimal number C37DD000 represents a decimal number using IEE
754 floating point format.
What decimal number does this represent? Show all the working.
(6 Marks)
Binary representation : 11000011011111011101000000000000
Sign bit = 1 means negative number
Exponent = 10000110 = 134 then actual value = 143-127 = 7
Mantissa = 11111011101000000000000
After denormalization and shifting by exponent value
1111110.11101000000000000
In decimal 253.8125
Question 3 (30 marks)
Write a Little Man Computer program using symbolic addressing that shows as
output the sums of the odd values from 1 to 15 (inclusive).
The output will consist of the sums of the following sequence:
1, 1+ 3, 1 + 3 + 5, 1 + 3 + 5 + 7,….., 1 + 3 + 5 …… + 15.
Use the concepts of the Little Man Computer introduced in Lecture 4 only.
No input is required to do this task.
What do you notice about the output results that are produced by this sequence?
Note:
1. Use the executable LMC2.exe (provided with Tutorial 4) to test your
program.
2. You will need to submit your LMC program, pasted below the other answers
for this question.
2
Document Page
LDA 09
OUT
STO 11
LDA 12
ADD 10
STO 12
ADD 11
BR 01
HLT # then terminate the program
DAT 001 # 09 initial value
DAT 002 # 10 constant for series
DAT 000 # 11 num1 previous result
DAT 001 # 12 num2 next num to add
-----------------------------------------------
3
chevron_up_icon
1 out of 3
circle_padding
hide_on_mobile
zoom_out_icon
logo.png

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]