1
| Symbol | Memory Location (Hex) |
|---|---|
| S2 | |
| S1 | |
| A | |
| One |
MARIE instructions: (Hexadecimal)
HEX 1108 / Load A
HEX 3109 / Add One
HEX 9106 / Jump S1
HEX 3109 / Add One
HEX 2108 / Store A
HEX 7000 / Halt
HEX 3108 / Add A
HEX 9103 / Jump S2
HEX 0023 / A
HEX 0001 / Onetitle: Correct answer.2
Jump 00BAdd 009
title: Correct answer.3
/ Tutorial Exercise 3
Load X / Load given X
Subt One / Prepare the X > 1 statement
Skipcond 800 / Interpret it as (X - 1) > 0 for truthy outcome
Jump EndIf / If X > 1 then:
Load X / Y = X + X
Add X
Store Y
Clear / X = 0
Store X
EndIf, Load Y / Y = Y + 1
Add One
Store Y
Halt
X, DEC 2
Y, DEC 8
One, DEC 1title: Correct answer.4
/ Tutorial Exercise 4
/ C = C + D
Load C
Add D
Store C
/ A = (A + B) - C
Load A
Add B
Subt C
Store Sum
Halt
A, DEC 4
B, DEC 3
C, DEC 2
D, DEC 1
Sum, DEC 0memory accesses.
title: Correct answer./ TE 4 Optimised
Load A
Add B
Subt C
Subt D
Store Sum
Halt
A, DEC 4
B, DEC 3
C, DEC 2
D, DEC 1
Sum, DEC 0 This is memory accesses.
5
| Step | RTL | PC | IR | MAR | MBR | AC |
|---|---|---|---|---|---|---|
| Fetch | ||||||
| Decode | ||||||
| Execute | ||||||
| Fetch | ||||||
| Decode | ||||||
| Execute | ||||||
| Fetch | ||||||
| Decode | ||||||
| Execute | ||||||
| Fetch | ||||||
| Decode | ||||||
| Execute | ||||||
| Fetch | ||||||
| Decode | ||||||
| Execute | ||||||
| Fetch | ||||||
| Decode |
title: Correct answer(?)