Memory Organization and MARIE Programming Assignment for ITC544 Course
VerifiedAdded on 2022/12/29
|7
|1245
|32
Homework Assignment
AI Summary
This assignment solution addresses key concepts in computer organization and architecture. The solution begins with a problem on IEEE-754 single-precision floating-point representation, detailing the steps to convert binary digits to their decimal equivalent. It then provides solutions for number conversions between different bases including hexadecimal, octal, binary, and decimal. The core of the assignment involves writing a MARIE assembly language program that determines if a user-inputted integer is a prime number, outputting 1 if prime and 0 otherwise. The solution also explains the concepts of high-order and low-order interleaving in memory organization, providing examples of address structure and module organization in a memory system. The assignment covers a wide array of topics from computer architecture, including memory organization, number systems, and assembly-level programming using MARIE.

Running head: Memory Organization 1
Marie Simulator and Memory Organization
Name of the Student
Name of the Institution
Marie Simulator and Memory Organization
Name of the Student
Name of the Institution
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Memory Organization 2
Marie Simulator and Memory Organization
Question 1.
a) A Computer uses IEEE-754 single precision format to represent floating points. What value
(in decimal) the computer represents if the floating point is represented using the following
binary digits. Show all the steps used in finding the answer.
0 01111110 10100000000000000000000
The first bit is 0, implying that s = +1.
The next 8 bits are 01111110,
E = (01111110)2
= 126
But E = e+ 127
Therefore, e = 127-126
= 1.
The last 23 bit represent the fractional part.
The mantissa x = 1 + (1/4 +0 +1/16 + 0 +…. + 0)
= 1.3125
The decimal representation of this number becomes + 1.3125*21
b) Convert the following numbers. (Please show all steps; no marks will be awarded if no steps
are shown)
i) 0xAD9 into 3-base representation
0x implies that this is a hexadecimal number
First we convert BAD into its equivalent decimal number as follows
BAD16 = B*162 + A*161 + D*160
Marie Simulator and Memory Organization
Question 1.
a) A Computer uses IEEE-754 single precision format to represent floating points. What value
(in decimal) the computer represents if the floating point is represented using the following
binary digits. Show all the steps used in finding the answer.
0 01111110 10100000000000000000000
The first bit is 0, implying that s = +1.
The next 8 bits are 01111110,
E = (01111110)2
= 126
But E = e+ 127
Therefore, e = 127-126
= 1.
The last 23 bit represent the fractional part.
The mantissa x = 1 + (1/4 +0 +1/16 + 0 +…. + 0)
= 1.3125
The decimal representation of this number becomes + 1.3125*21
b) Convert the following numbers. (Please show all steps; no marks will be awarded if no steps
are shown)
i) 0xAD9 into 3-base representation
0x implies that this is a hexadecimal number
First we convert BAD into its equivalent decimal number as follows
BAD16 = B*162 + A*161 + D*160

Memory Organization 3
Since B= 11, A = 10 and D = 13, then
BAD16 = 11*162 + 10*161 + 13*160
= 2989
Converting 2989 into equivalent base 3 representation,
Recursively divide it by 3 and pick the remainders from bottom.
Number divisor remainder
2889/3 996 1
996/3 332 0
332/3 110 2
110/3 36 2
36/3 12 0
12/3 4 0
4/3 1 1
1/3 0 1
BAD16 = 110022013
ii) 4518 into 2-base (binary) representation
To convert the number into its equivalent binary representation, we get 3-bit binary value of
each digit. As such, 18= 0012, 58= 1012, and 48 = 1002.
4518 = 1001010012. (Joining the 3-bit binary representation of each octal number.)
iii) 123.35 into octal representation (up to 3 octal points)
First the number is converted to its equivalent decimal.
52*1 + 2*51 + 3 + 3*1/5
= 38.6
Since B= 11, A = 10 and D = 13, then
BAD16 = 11*162 + 10*161 + 13*160
= 2989
Converting 2989 into equivalent base 3 representation,
Recursively divide it by 3 and pick the remainders from bottom.
Number divisor remainder
2889/3 996 1
996/3 332 0
332/3 110 2
110/3 36 2
36/3 12 0
12/3 4 0
4/3 1 1
1/3 0 1
BAD16 = 110022013
ii) 4518 into 2-base (binary) representation
To convert the number into its equivalent binary representation, we get 3-bit binary value of
each digit. As such, 18= 0012, 58= 1012, and 48 = 1002.
4518 = 1001010012. (Joining the 3-bit binary representation of each octal number.)
iii) 123.35 into octal representation (up to 3 octal points)
First the number is converted to its equivalent decimal.
52*1 + 2*51 + 3 + 3*1/5
= 38.6
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Memory Organization 4
Then the decimal number is converted to octal. For the whole number, recursively divide by
8. So 3810 = 468. For the decimal part, multiply through by 8 and recursively hold the whole
number in the product.
0.6= 0.6*8 = 4.8
0.8*8 = 6.4
0.4*8 = 3.2
0.2*8 = 1.6
0.6*8 = 4.8
0.6 Base 10 therefore becomes 0.4631 (4 decimal places) in base 7.
38.610 = 123.35 = 46.4638 (to three octal places)
iv) 14.358 into decimal representation
We first convert the number into equivalent binary as per the table below.
1 4 3 5
001 100 011 101
= 1100.0111012
Converting this number to decimal
= 1*23 +1*22 + ¼ + 1/8 + 1/16 + 1/64
= 12.453125.
Question 2.
Write a MARIE program that accepts an integer from the user, and if it is a prime number the
program will output 1, otherwise, the program will output 0.
.MODEL SMALL
.DATA
MSG DB “1”
NMSG DB “0”
NUM DB 71H ; Enter the required no here
.CODE
Then the decimal number is converted to octal. For the whole number, recursively divide by
8. So 3810 = 468. For the decimal part, multiply through by 8 and recursively hold the whole
number in the product.
0.6= 0.6*8 = 4.8
0.8*8 = 6.4
0.4*8 = 3.2
0.2*8 = 1.6
0.6*8 = 4.8
0.6 Base 10 therefore becomes 0.4631 (4 decimal places) in base 7.
38.610 = 123.35 = 46.4638 (to three octal places)
iv) 14.358 into decimal representation
We first convert the number into equivalent binary as per the table below.
1 4 3 5
001 100 011 101
= 1100.0111012
Converting this number to decimal
= 1*23 +1*22 + ¼ + 1/8 + 1/16 + 1/64
= 12.453125.
Question 2.
Write a MARIE program that accepts an integer from the user, and if it is a prime number the
program will output 1, otherwise, the program will output 0.
.MODEL SMALL
.DATA
MSG DB “1”
NMSG DB “0”
NUM DB 71H ; Enter the required no here
.CODE
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Memory Organization 5
START: MOV AX,@DATA
MOV DS,AX
MOV AL,NUM
MOV BL,02H ; The Dividing starts from 2, Hence BH is compare to 02H
MOV DX,0000H ; To avoid Divide overflow error
MOV AH,00H ; To avoid Divide overflow error
;Loop to check for Prime No
L1:DIV BL
CMP AH,00H ; Remainder is compared with 00H (AH)
JNE NEXT
INC BH ; BH is incremented if the Number is divisible by current value of BL
NEXT:CMP BH,02H ; If BH > 02H, There is no need to proceed, It is not a Prime
JE FALSE ; The no is not a Prime No
INC BL ; Increment BL
MOV AX,0000H ; To avoid Divide overflow error
MOV DX,0000H ; To avoid Divide overflow error
MOV AL,NUM ; Move the Default no to AL
CMP BL,NUM ; Run the loop until BL matches Number. I.e, Run loop x no of times, where x is
the Number given
JNE L1 ; Jump to check again with incremented value of BL
;To display The given no is a Prime No
TRUE: LEA DX,MSG
MOV AH,09H ; Used to print a string
INT 21H
JMP EXIT
;To display The given no is not a Prime No
FALSE: LEA DX,NMSG
MOV AH,09H ; Used to print a string
INT 21H
EXIT:
MOV AH,4CH
INT 21H
END STAR
Question 3.
a) Explain with an example of what is meant by high-order interleaving and low-order
interleaving in memory organisation.
START: MOV AX,@DATA
MOV DS,AX
MOV AL,NUM
MOV BL,02H ; The Dividing starts from 2, Hence BH is compare to 02H
MOV DX,0000H ; To avoid Divide overflow error
MOV AH,00H ; To avoid Divide overflow error
;Loop to check for Prime No
L1:DIV BL
CMP AH,00H ; Remainder is compared with 00H (AH)
JNE NEXT
INC BH ; BH is incremented if the Number is divisible by current value of BL
NEXT:CMP BH,02H ; If BH > 02H, There is no need to proceed, It is not a Prime
JE FALSE ; The no is not a Prime No
INC BL ; Increment BL
MOV AX,0000H ; To avoid Divide overflow error
MOV DX,0000H ; To avoid Divide overflow error
MOV AL,NUM ; Move the Default no to AL
CMP BL,NUM ; Run the loop until BL matches Number. I.e, Run loop x no of times, where x is
the Number given
JNE L1 ; Jump to check again with incremented value of BL
;To display The given no is a Prime No
TRUE: LEA DX,MSG
MOV AH,09H ; Used to print a string
INT 21H
JMP EXIT
;To display The given no is not a Prime No
FALSE: LEA DX,NMSG
MOV AH,09H ; Used to print a string
INT 21H
EXIT:
MOV AH,4CH
INT 21H
END STAR
Question 3.
a) Explain with an example of what is meant by high-order interleaving and low-order
interleaving in memory organisation.

Memory Organization 6
Memory interleaving is defined as a process and technique of that is used to increase
throughput- jobs processed per unit time, usually in a second. Memory is divided into
different and independent banks with each bank having the ability of reading and writing
requests. As such, parallel processing is realized. Address space is the most interleaved
‘section’ in a process in which all consecutive cells in the address space are assigned to
different memory banks. Generally, there are two methods of interleaving address space-
low- and high-order interleaving.
Low order interleaving is an interleaving method that horizontally spreads all contiguous
memory locations across all modules. As such, low order bits in the address space are
used to identify the module while high order bits represents word addresses in each
module. High order interleaving on the other hand vertically spreads memory location
thus using high order bits as module addresses and low order bits as word addresses in
each module.
Examples
Suppose we want to create a 256M words- memory system consisting of four modules,
each of 64M word. Suppose M0, M1, M2, and M3 represent the four modules/blocks, and since
256 = 28, the system will have A0-A27. Each of the memory block will have address pins in the
range of A0 to A26 since 64M = 226.
High-order interleaving would arrange the blocks as shown.
Address Module
0-64M 0
64M-128M 1
128-192M 2
192M-256M 3
Low-order interleaving would be as follows
Address Module
0 0
1 1
2 2
3 3
4 0
5 1
6 2
7 3
8 0
9 1
etc etc
Memory interleaving is defined as a process and technique of that is used to increase
throughput- jobs processed per unit time, usually in a second. Memory is divided into
different and independent banks with each bank having the ability of reading and writing
requests. As such, parallel processing is realized. Address space is the most interleaved
‘section’ in a process in which all consecutive cells in the address space are assigned to
different memory banks. Generally, there are two methods of interleaving address space-
low- and high-order interleaving.
Low order interleaving is an interleaving method that horizontally spreads all contiguous
memory locations across all modules. As such, low order bits in the address space are
used to identify the module while high order bits represents word addresses in each
module. High order interleaving on the other hand vertically spreads memory location
thus using high order bits as module addresses and low order bits as word addresses in
each module.
Examples
Suppose we want to create a 256M words- memory system consisting of four modules,
each of 64M word. Suppose M0, M1, M2, and M3 represent the four modules/blocks, and since
256 = 28, the system will have A0-A27. Each of the memory block will have address pins in the
range of A0 to A26 since 64M = 226.
High-order interleaving would arrange the blocks as shown.
Address Module
0-64M 0
64M-128M 1
128-192M 2
192M-256M 3
Low-order interleaving would be as follows
Address Module
0 0
1 1
2 2
3 3
4 0
5 1
6 2
7 3
8 0
9 1
etc etc
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Memory Organization 7
b) Suppose we have a memory consisting of 32 4Kx8-bit chips.
Show the address structure and module organisation when
i. high-order interleaving is used
Address Module
0-8M 0
8M-16M 1
16-24M 2
24M-32M 3
ii. low-order interleaving is used.
Address Module
0 0
1 1
2 2
3 3
4 0
5 1
6 2
7 3
8 0
0 1
etc etc
b) Suppose we have a memory consisting of 32 4Kx8-bit chips.
Show the address structure and module organisation when
i. high-order interleaving is used
Address Module
0-8M 0
8M-16M 1
16-24M 2
24M-32M 3
ii. low-order interleaving is used.
Address Module
0 0
1 1
2 2
3 3
4 0
5 1
6 2
7 3
8 0
0 1
etc etc
1 out of 7
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.