preview

Nt1210 Lab

Decent Essays

The objective of this lab is to be able to understand how the CPU functions work, as well as understanding machine and assembly language.

Results:
What I found out is that after doing the lab is that there are three cycles that the CPU goes through in order for the program to be executed. I was able to come up with small programs for 2a and 3b that will execute according to the instructions given in the lab, which is shown below.

Conclusions:

I thought this lab was really awesome because I was able to construct a machine language program in binary code, as well as being able to put together a short assembly language program. What I have implemented from this lab is that the Central Processing Unit (CPU) is able to fetch, decode, and execute …show more content…

1 - Explain the cycles that CPU goes through in the animation of Lecture 1:

There are three cycles that the CPU goes through in the animation of Lecture 1:

• Fetch Cycle: CPU reads an instruction from the memory
• Decode Cycle: CPU breaks the patterns into two parts (first three bits are place in the OPR, while the last 5 bits are place in the ADDR)
• Execute Cycle: CPU performs the instructions

IV. 2.a - Write the machine language program (binary code).
10010100
00010101
00010110
00010111
00011000
10111001
11100000
IV. 2.b - Write the assembly language program.
LOAD 20 //Loads the present value located at address 20 for A
ADD 21 //Adds the content at address 21 to A
ADD 22 //Adds the content at address 22 to A
ADD 23 //Adds the content at address 23 to A
ADD 24 //Adds the content at address 24 to A
STORE 25 //Stores the values
HALT //The end of the program

IV. 3.a - Write the assembly language program.
Start Ent 1:

D1 A : 5
D2 B : 6
D3 C : 7

Ent 1: MOV R1, A; //Content of A moves into R1 MOV R2, B; //Content of B moves into R2 MOV R3, C; //Content of C moves into R3

ADD R1, #4; //Adding the value of 4 to R1 ADD R2, #4; //Adding the value of 4 to

Get Access