COMPUTERS, DATA AND PROGRAMMING: Solutions and MARIE Assembly Example

Verified

Added on  2022/09/01

|13
|1526
|22
Homework Assignment
AI Summary
This assignment delves into the fundamental concepts of computers, data, and programming. It begins with a historical overview of computer systems, tracing the evolution of computer architecture from the theoretical Turing machine to the von Neumann architecture, and discussing the significance of Moore's Law. The assignment then explores data representation in computers, covering signed magnitude, one's complement, and two's complement representations, with examples. Finally, it provides a detailed examination of MARIE assembly language, including example code for arithmetic operations, memory access, and control flow, demonstrating how to write and analyze MARIE programs using both MARIE simulator and Data Path Simulator.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: COMPUTERS, DATA AND PROGRAMMING
Computers, Data and Programming
Name of the Student
Name of the University
Author Note
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
1COMPUTERS, DATA AND PROGRAMMING
Table of Contents
Solution 1: Historical Overview of Computer System..............................................................2
Solution 2: Data Representation in Computers..........................................................................3
Solution 3: MARIE Assembly...................................................................................................4
Bibliography.............................................................................................................................12
Document Page
2COMPUTERS, DATA AND PROGRAMMING
Solution 1: Historical Overview of Computer System
a. In stored program, idea of computer architecture can be tracking back to the
theoretical idea of universal Turing machine in the early 1936. Here, the instructions
and data, both are logically the equivalent and can be stored in the memory.
The von Neumann architecture computer system is a design model that stores
the instruction and program data in the same memory (Stratila & Zsidó , 2019). In
contrast to parallel architecture, it (von Neumann architecture computer system)
creates a general Turing machine along with a referential model specifying successive
activities.
It is occasionally used as a replacement for von Neumann architecture,
however the researcher reflects that it is generally unsuitable, to mention to electronic
stored-program digital processors as 'von Neumann machines (Ando & Haagerup,
2014). Von Neumann planned that a sequence be automatically keeping in binary-
number set-up in a memory device so that the processer as define by transitional
computational consequences could modify commands.
b. Moore’s Law:-
Moore's Law mentions to Moore's opinion that the transistors number on a
microchip pair each two years, though the computers cost is halved (Waldrop, 2016).
This law defines that the people can assume the processors capability and speed to
Document Page
3COMPUTERS, DATA AND PROGRAMMING
rise every times. Another principle of Moore's Law declares that this progress is
exponential.
Moore's Law proposes that technologies and processors that run on processors,
and computing command all become faster, lesser and inexpensive with time, as
transistors on integrated circuits develop more effective.
There are several process has come to holds with the help of Moore’s law. The
ultimatum for battery-operated movable gadgets is growing day by day with lots of
applications counting wearable, phones, hearing aids, laptops etc. The elementary
necessities of any such claims are lower power consumption and less area. This laws
are using for portable devices. The power intemperance is vital because the power
delivered by the battery is unlimited (Mack, 2015). Moore’s Law defines those
transistors on a chip dual about every one to two years. The practical implication of
Moore’s law are always determine with respect to the transistor count and variable.
Solution 2: Data Representation in Computers
a. Signed magnitude is 0111 to 1111 (7 to (-7)
One’s complement 0111 to 1000 (7 to -7)
Two’s complement 0111 to 1001 (7 to -8) (Answer)
b. Let us assume that the x no bit is 3
Therefore, the word is 3-bit range then
Then the signed magnitude is 011 to 111 that (+3 to -3)
One’s complement is 011 to 100 that (+3 to -3)
Two’s complement is 011 to 101 that (+3 to -4)
c. Hexadecimal to binary
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
4COMPUTERS, DATA AND PROGRAMMING
C29C3480= 11000010100111000011010010000000
Binary to decimal
11000010100111000011010010000000=326501696010
Solution 3: MARIE Assembly
a. Consider the arithmetic operation Sum = (A + B) - (C + D), In MARIE the tasks
needed to be done are LOAD the value of C to the accumulator, then ADD D to add
the value of D to the accumulator and store the result in Sum. Value of B is loaded
into the accumulator next the value of A is added to the accumulator using the ADD
A op-code. Finally the current accumulator value is subtracted from the location Sum
and then the accumulator value is displayed as an output using OUTPUT op-code.
Let us take an example for the above operation where, A = 5, B = 10, C = 2 and D =
7.
The MARIE code is as follows:
ORG 100 // Origin location allocated at 100
input //Input from the keyboard to ACC
store A // Store the value from the ACC into address A
input //Input from the keyboard to the ACC
store B // Store the value from the ACC into address B
input //Input from the keyboard to ACC
store C // Store the value from the ACC into address C
input //Input from the keyboard to the ACC
store D // Store the value from the ACC into address D
Document Page
5COMPUTERS, DATA AND PROGRAMMING
load C // Load C=2 to ACC
add D // Add the value D=7 to the ACC; Now ACC= 9
store Sum // Store the result of ACC to location Sum
load B // Input B=10 to the ACC
add A // Add the value of A=5 to the ACC; Now ACC= 15
subt Sum // Subtract the value in ACC at from location Sum; 15-9=6
output // Display the result from the ACC
halt
A, hex 0
C, hex 0
B, hex 0
D, hex 0
Sum, hex 0
Fig: Running the code in MARIE simulator
Document Page
6COMPUTERS, DATA AND PROGRAMMING
Fig: Running the example code in Data Path Simulator
From the above code compilation, we can finally conclude the following for the
example taken:
Number of memory access necessary: 26
Value of AC on completion of successful machine halt: 6
Value of MBR on completion of successful machine halt: 6
Let us consider the following code:
ORG 100 // Origin location allocated at 100
load C // Load C=2 to the ACC
add D // Add the value D=7 to the ACC; Now ACC= 9
store Sum // Store the ACC result to location Sum
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
7COMPUTERS, DATA AND PROGRAMMING
load B // Input B=10 to the ACC
add A // Add value A=5 with ACC value; Now ACC= 15
subt Sum // Subtract the value in ACC at from location Sum; 15 - 9=6
output // Display the result from the ACC
halt
A, dec 05
B, dec 10
C, dec 02
D, dec 07
Sum, hex 0
Fig: Running the example code in MARIE simulator
Document Page
8COMPUTERS, DATA AND PROGRAMMING
Fig: Running the example code in Data Path Simulator
The above code holding memory data values in registers. Hence from the
compilation, we can finally conclude the following:
Number of memory access necessary: 14
Value of AC on completion of successful machine halt: 6
Value of MBR on completion of successful machine halt: 6
b. The programming code is as follows:
ORG 100 // Origin location allocated at 100
START, INPUT //Input from keyboard to ACC
STORE TEMP //Store the value from the ACC to location A
SKIPCOND 800 //Skips if ACC > 0
JUMP FINAL//Jumps to FINAL
Document Page
9COMPUTERS, DATA AND PROGRAMMING
ADD SUM //Add the value of sum with ACC value
STORE SUM //Store value from the ACC to location SUM
LOAD TEMP //Load TEMP value to the ACC
SUBT MIN //Subtract the value of ACC from location MIN
SKIPCOND 800 //Skips if ACC > 0
JUMP least //Jumps to least number loop
cnt, LOAD COUNT //Load the COUNT value to the ACC
ADD ONE //Add the value of ONE with ACC value
STORE COUNT //Store the value from the ACC to
location COUNT
JUMP START //Jumps to START
FINAL, LOAD COUNT //Load the COUNT value to the ACC
OUTPUT //Display the COUNT value from the ACC
LOAD MIN //Load the MIN value to the ACC
OUTPUT //Display the MIN value from the ACC
LOAD SUM //Load the SUM value to the ACC
OUTPUT //Display the SUM value from the ACC
HALT
least, LOAD TEMP //Load the TEMP value to the ACC
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
10COMPUTERS, DATA AND PROGRAMMING
STORE MIN //Store value from the ACC to location MIN
JUMP cnt //Jumps to Counting loop CNT
TEMP, hex 0
COUNT, hex 0
SUM, hex 0
ONE, Dec 1
MIN, Dec 300
Output
Fig: Running the example code in MARIE simulator
Document Page
11COMPUTERS, DATA AND PROGRAMMING
Fig: Running the example code in Data Path Simulator
Document Page
12COMPUTERS, DATA AND PROGRAMMING
Bibliography
Ando, H., & Haagerup, U. (2014). Ultraproducts of von Neumann algebras. Journal of
Functional Analysis, 266(12), 6842-6913.
Mack, C. (2015). The multiple lives of Moore's law. IEEE Spectrum, 52(4), 31-31.
Stratila, S. V., & Zsidó, L. (2019). Lectures on von Neumann algebras. Cambridge
University Press.
Waldrop, M. M. (2016). The chips are down for Moore’s law. Nature News, 530(7589), 144.
chevron_up_icon
1 out of 13
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]