Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

TD

Computer Architecture
By Eng. Ibrahim Jomaa
Consider the following binary codes of a set of
instructions represented over one byte:
Binary Assembly Signification
000 xxxxx END End of Execution, x can have any value.
Load into the accumulator the content of the
001 xxxxx LD A X
memory address xxxxx
Add the content of the memory address xxxxx to
010 xxxxx ADDA X
the accumulator
Store the content of the accumulator at memory
011 xxxxx STAX X
address xxxxx
The next instruction to be executed is at memory
101 xxxxx JP X
address xxxxx
The next instruction to be executed is at memory
110 xxxxx JNEG X address xxxxx if the content of the accumulator
is negative
Having the following program at address 0 in main
memory:
Address Content
0 001 01001 1. During the execution of the instruction in the
010 01010 address 2, what are the contents of the program
1
counter and the instruction register.
2 011 01011
2. What is the content of the program counter at the
3 101 00111 end of execution of the program. (when the
4 001 10001 programs stops, the program counter contains the
address of the last executed instruction).
5 101 11000
3. Describe in a few lines the operations executed by
6 110 01011 this program.
7 000 10101 4. What are the contents of the memory from address 0
101 01000 to address 11 after the execution of the program.
8
9 000 01110

10 101 11001

11 000 00000
PC IR ASM Reg. A

1 001 01001 LD A 01001 000 01110


2 010 01010 ADDA 01010 000
110 00111
01110
0 001 01001 3 011 01011 STAX01011 110 00111
1 010 01010 7 101 00111 JP 00111 110 00111
2 011 01011 7 000 10101 END 110 00111
3 101 00111
4 001 10001
5 101 11000
6 110 01011
7 000 10101
8 101 01000
9 000 01110
10 101 11001
11 000
110 00000
00111
1. During the execution of the instruction in the address 2,
what are the contents of the program counter and the
instruction register.
PC = 3 IR = 011 01011
2. What is the content of the program counter at the end of
execution of the program. (when the programs stops, the
program counter contains the address of the last
executed instruction).
PC = 7
3. Describe in few lines the task of this program.
This program adds two numbers located at addresses 9 and 10
respectively and stores the result at address 11.
4. What would be the values of the memory addresses 0 to 11 at
the end of each execution of the program?
Only the content of address 11 changes from
0000 0000
Into
1100 0111
END

You might also like