ECE 109 Ch. 4
What is a register?
A register is a temporary storage location which can be accessed in a single machine cycle, as opposed to the several cycles it takes a write or read operation to occur in memory. The LC-3 has 8, 16-bit, "general purpose registers" which are directly addressable by the programmer and used by the ALU to store the results of operations. The LC-3 also has many other non-GPRs which are read and set by other commands. For example, the Program Counter Register (PC) is used by the control unit to store the address of the next command to be run.
What is an opcode?
An opcode is the first part of an instruction which tells the computer what to do with the data given. EX: In the command "0001 010 000 0 00 001" (ADD R2, R0, R1) the first four digits (0001) make up the Opcode.
Define CISC
CISC means Complex Instruction Set Computer. A CISC computer has many instructions, a large variable size, is very memory optimal, and typically has fewer registers.
What are control instructions?
Control instructions are special instructions that change the contents of the PC. They load the PC during the EXECUTE phase of instruction processing which wipes out the incremented PC that was loaded during the FETCH phase. The result is that, during the next instruction cycle, rather than loading the next sequential instruction in the computer's program, the computer will get the address loaded during the previous EXECUTE phase.
Define Input and Output in the Von Neumann Context
Input devices get information into the computer while output devices display the results of program execution. The two most basic forms are a keyboard and a text output monitor.
What is an instruction?
Instructions are the commands which tell the computer what to do. They are the smallest pieces of work that a computer can do. A computer either does a whole instruction or does not do it at all. A computer cannot do only part of an instruction. There are two parts of an instruction: the "opcode" and the "operands." EX: The code "0001 010 000 0 00 001" is an instruction which tells the LC-3 to ADD the contents of R0 and R1 and put the result in R2.
What are the three main components and two interface components of the von Neumann model?
Main components: Memory, Processing Unit, and Control Unit Interfaces: Input and output
Define Memory in the von Neumann context
Memory in a von Neumann or stored program computer holds the code to be executed by the computer, as well as stores longer term data. It consists of 2^n bits, addressed by an n-bit register. In the LC-3, the memory is 2^16 bits large and addressed by at 16-bit address. The memory also includes two registers: the MAR which holds the location to be accessed by the computer and the MDR which holds the data to be stored in/just read from the memory location indicated in the MAR.
Define RISC
RISC means Reduced Instruction Set Computer A RISC architecture has fewer instructions (all of a fixed size), it has more registers, and is more optimized for speed. Also called a "Load/Store" architecture.
What is the difference between registers and memory?
Registers can usually be accessed in one machine cycle where as memory access takes several cycles. Registers are used to store temporary data as a program executes. Memory is used for program storage and long term data storage.
What is the ALU?
The Arithmetic Logic Unit or ALU of a computer is responsible for doing arithmetic (ADD, SUB, MUL, DIV) and logical operations (EX: AND, OR, NOT, XOR). The LC-3's ALU can only do three It is also the simplest type of processing unit. More modern computers have have complex parts in their processing units dedicated to doing square roots, dividing, etc.
What happens, in general, during the DECODE phase?
The DECODE Phase examines the instruction in order to figure out what the micro architecture is being asked to do. In the LC-3, a 4-to-16 decoder identifies which of 16 opcodes is being processed based on the [15:12] bits.
What happens, in general, during the EVALUATE ADDRESS phase?
The EVALUATE ADDRESS phase computes the address of the memory location that is needed to process the instruction. For example, in the instruction LDR R3, R2, #6, the address of the data to be loaded into R3 is computed during this phase.
What happens, in general, during the EXECUTE phase?
The EXECUTE phase carries out the execution of the instruction. For example, in the ADD instruction, this consists of the single step of performing the addition in the ALU.
What happens, in general, during the FETCH OPERANDS phase?
The FETCH OPERANDS phase obtains the source operands needed to process the instruction. For example, the LDR command requires two steps: loading MAR with address caluclated in the EVALUATE ADDRESS phase, and reading memory, which resulted in the source operand being placed in MDR. The ADD command reads from R2 and R6 during this phase.
What happens, in general, during the FETCH phase?
The FETCH phase obtains the next instruction from memory and loads it into the instruction register (IR) of the control unit. It does this in 3 steps: 1) Load the MAR with the PC and simultaneously increment the PC 2) Send read command to memory 3) Write the IR with the contents of the MDR
What is an Instruction Set Architecture?
The Instruction Set Architecture (ISA) defines everything a machine language programmer needs to know in order to program a computer. In other words, the ISA specifies everything in the computer that is available to a programmer when he/she writes programs in the computer's own machine language. It specifies the memory organization, register set, and instruction set (including opcodes, data types and addressing modes)
How does the LC-3 interface with memory?
The LC-3 has two special registers which are used to access memory: the memory address register (MAR) and the memory data register (MDR). When loading from memory, the LC-3 (1) writes the address of the memory to be accessed in the MAR, (2) sends a "read" signal to the memory, and (3) reads the data from the MDR. When storing to memory, the process happens in reverse. The LC-3 (1) writes the data to be stored in the LDR, (2) writes the address of the memory to be stored to in the MAR, and (3) sends a "write" signal to the memory.
What happens, in general, during the STORE RESULT phase?
The STORE RESULT phase writes the result of the operation to its final, designated destination. After this phase, the control unit begins anew with the FETCH phase.
Define Control Unit in the von Neumann Context
The control unit is like the conductor of an orchestra; it is charge of making all the other parts play together. It is responsible for keeping track of both where we are within the process of executing a program as well as where we are within the process of executing each instruction. The control unit contains an instruction register which contains the current instruction being executed and a program counter which contains the memory address of the next instruction to be executed.
What's the difference in machine cycles and instruction cycles?
The instruction cycle is the time it takes to do a single instruction. Different instructions may have different instruction cycle lengths. An instruction cycle is always a multiple of a single machine cycle. Machine cycles/clock cycles are represented by the frequency of a computer. Each machine cycle corresponds to one action by the Control Unit.
What is an instruction register?
The instruction register contains the current instruction being executed.
What are operands?
The operands make up the rest of the instruction, and are what the opcode is acting on. EX: In the command "0001 010 000 0 00 001" (ADD R2, R0, R1), the digits "010," "000," and "001" indicate the operands of the instruction.
What is the program counter?
The program counter contains the address of the next instruction to be executed.
What is the sequence of operations required to execute an instruction?
There are six phases of instruction execution: FETCH, DECODE, EVALUATE ADDRESS, FETCH OPERANDS, EXECUTE, and STORE RESULT Each phase may take multiple steps and each step of a phase may take multiple machine cycles. Not every instruction (I.E. ADD, LDR) uses every phase.
Define the Processing Unit in the context of the von Neumann context
What carries out the actual processing of information in a computer. May consist of many sophisticated complex functional units, each performing a particular operation (divide, square root, etc.). The simplest processing unit is an ALU. The processing unit almost always includes storage very close to the processing unit to allow results to be temporarily stored if they will need to produce additional results in the near future. In the LC-3, the processing unit consists of an ALU and eight registers (R0-R7)
Define word size
Word size indicates the size of quantities normally processed by the computer. For example, in the LC-3 computer, the word size is 16-bits and ALU processes 16-bit quantities. In more practical terms, this means that you cannot do an operation on two 32-bit or two 64-bit numbers in a single instruction cycle using the LC-3.