MARIE: Introduction to Simple Computer System

 
MARIE:
An Introduction to a Simple Computer
 
 
Lecture Overview
 
A simple program
A discussion on assemblers
Extending our ISA
 
 
A simple program
 
A Simple program
 
The figure below shows a program written in
assembly language for MARIE
What does this program do?
 
 
A simple program
 
A Simple program
 
This program simply adds to numbers and stores the
result in the main memory.
It loads the value stored at the location address 104
16
 into
AC (the value is 0023
16
 = 35
10
), ), 
(2*16
1
+3*16
0
) or 0000 0000 00
10 0011
=35)
 
It adds this value to the value stored at the location
address 105
16
 (the value is FFE9
16
 = (-23)
10
), 
(1111 1111 1110
1001)=0000 0000 0001 0110+1 =-23)
Stores the sum into the location address 106
16
.
-
So what will be stored in the location address 106
16
?
Now let us discover what happens during each “Fetch,
decode, execute” cycle.
 
 
Lecture Overview
 
A simple program
A discussion on assemblers
Extending our ISA
 
 
What do Assemblers do
 
A discussion on Assemblers
 
Assembly language
 can be understood by the programmer
but not the computer!
Assembly language must be converted into 
Machine Codes
(binary codes) before being executed or even stored in the
main memory.
An Assembler 
is used to translate assembly language into
machine code
It reads a 
source file 
(assembly program) and convert it to an
object file 
(Machine code)
Assembler VS Compiler
An assembler translates each mnemonic instruction (written in
assembly) to exactly one machine code.
With compilers, this is not usually the case
 
 
 
Remember -
 Registers and Buses
 
MARIE
 
The Data path in MARIE
is shown in this figure
Note that a data word
(that is an instruction) in
the main memory travels
a relatively long path
before achieving the IR!
 
 
Remember - 
The Fetch-Decode-Execute cycle
 
Instruction processing
 
MARIE, like any
other computer
architecture, follow
the basic machine
cycle:
the fetch, decode,
and execute cycle
 
Fetch
 
Decode
 
Execute
 
Remember - 
The Von Neumann model
Chapter 1: Introduction
Instruction 1
Instruction 2
Instruction 3
Instruction 4
Instruction N
Instruction 3
 
1.
Fetch
PC indicates
the iteration
number
CU fill the
instruction
register
 
2. Decode
what ALU
should do
(add, multiply,
…)?
Fill registers
with needed
data
Data 1
Data 2
 
Remember - 
The Von Neumann model
Instruction 1
Instruction 2
Instruction 3
Instruction 4
Instruction N
Instruction 3
 
3. Execute
Execute the
instruction
Place the
results in
registers or
memory
Data 1
Data 2
Result
 
 
The Instruction Set Architecture
 
MARIE
 
The fundamental MARIE instructions are:
 
 
What do Assemblers do
 
A discussion on Assemblers
 
Going back to our simple program, what
really happens inside the CPU during each
fetch, decode, execute cycle?
Load 104:
 
 
What do Assemblers do
 
A discussion on Assemblers
 
Add 105:
 
 
 
 
Store 106:
 
 
What do Assemblers do
 
A discussion on Assemblers
 
An assembler directive 
is an instruction that
is not supposed to be translated into machine
code
 
 
 
 
 
In assembly language we can also use 
labels
in order to clarify the program
 
Example: 
base 16 is the
default base when writing
assembly program for MARIE,
to specify the used base we
can use “constant directives”
such as DEC (decimal) or HEX
(Hexadecimal)
Slide Note
Embed
Share

An introduction to MARIE, a simple computer system, explaining a program written in assembly language that adds two numbers and stores the result in memory. The process involves fetching, decoding, and executing instructions. The importance of assemblers in translating assembly language to machine code is also discussed, highlighting the role of registers and buses in instruction processing.

  • MARIE
  • Computer System
  • Assembly Language
  • Instruction Processing
  • Assemblers

Uploaded on Oct 05, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. MARIE: An Introduction to a Simple Computer

  2. Lecture Overview A simple program A discussion on assemblers Extending our ISA 2

  3. A Simple program A simple program The figure below shows a program written in assembly language for MARIE What does this program do? 3

  4. A Simple program A simple program This program simply adds to numbers and stores the result in the main memory. It loads the value stored at the location address 10416into AC (the value is 002316= 3510), ), (2*161+3*160) or 0000 0000 0010 0011 =35) It adds this value to the value stored at the location address 10516(the value is FFE916= (-23)10), (1111 1111 1110 1001)=0000 0000 0001 0110+1 =-23) Stores the sum into the location address 10616. - So what will be stored in the location address 10616? Now let us discover what happens during each Fetch, decode, execute cycle. 4

  5. Lecture Overview A simple program A discussion on assemblers Extending our ISA 5

  6. A discussion on Assemblers What do Assemblers do Assembly language can be understood by the programmer but not the computer! Assembly language must be converted into Machine Codes (binary codes) before being executed or even stored in the main memory. An Assembler is used to translate assembly language into machine code It reads a source file (assembly program) and convert it to an object file (Machine code) Assembler VS Compiler An assembler translates each mnemonic instruction (written in assembly) to exactly one machine code. With compilers, this is not usually the case 6

  7. MARIE Remember - Registers and Buses The Data path in MARIE is shown in this figure Note that a data word (that is an instruction) in the main memory travels a relatively long path before achieving the IR! 7

  8. Instruction processing Remember - The Fetch-Decode-Execute cycle MARIE, like any other computer architecture, follow the basic machine cycle: the fetch, decode, and execute cycle Fetch Decode Execute 8

  9. Chapter 1: Introduction Remember - The Von Neumann model 1. Fetch Instruction 1 PC indicates the iteration number CU fill the instruction register Instruction 2 Instruction 3 Instruction 3 Data 1 Data 2 Instruction 4 2. Decode what ALU should do (add, multiply, )? Fill registers with needed data Instruction N 9

  10. Remember - The Von Neumann model 3. Execute Execute the instruction Place the results in registers or memory Instruction 1 Instruction 2 Instruction 3 Instruction 3 Data 1 Data 2 Instruction 4 Result Instruction N 10

  11. MARIE The Instruction Set Architecture The fundamental MARIE instructions are: 11

  12. A discussion on Assemblers What do Assemblers do Going back to our simple program, what really happens inside the CPU during each fetch, decode, execute cycle? Load 104: 12

  13. A discussion on Assemblers What do Assemblers do Add 105: Store 106: 13

  14. A discussion on Assemblers What do Assemblers do An assembler directive is an instruction that is not supposed to be translated into machine code Example: base 16 is the default base when writing assembly program for MARIE, to specify the used base we can use constant directives such as DEC (decimal) or HEX (Hexadecimal) In assembly language we can also use labels in order to clarify the program 14

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#