Overview The von Neumann Machine the programmable digital
Overview The von Neumann Machine - the programmable digital computer Introducing the LC-3 Computer - A “toy” computer for us to learn from Computer machine instructions - the basic instructions that all programs use on that computer The Instruction Cycle - the steps in the execution of a machine language instruction
From Logic to Data Path • The data path of a computer is all the logic used to process information. – See the data path of the LC-3 on next slide. • Combinational Logic – Decoders -- convert instructions into control signals – Multiplexers -- select inputs and outputs – ALU (Arithmetic and Logic Unit) -- operations on data • Sequential Logic – State machine -- coordinate control signals and data movement – Registers and latches -- storage elements
LC-3 Data Path: Combinational Logic Storage State Machine
The LC-3 as a von Neumann machine
Data Path of the LC-3
Computer Machine Instruction Formats What is IN an instruction? • Specifies the operation to be performed • Where to get the operands • Where to put the result What are the major instruction types? • Operate (add, sub, mult, OR, AND, etc. ) • Control (branch, jump to subroutine, etc. )
The Machine Instruction Necessary information: • Operation code • Input Operand(s) • Output Operand(s) Typical Operation formats: • 1 operand • 2 operands • 3 operands
The LC-3 Instruction FORMAT – generally 2 operand • Operation code • Input Operand(s) • Output Operand(s) Where are the operands? • Memory • Registers
The LC-3 Instruction ADDRESSING MODES • Register (Operand is in one of the 8 registers) • PC-relative (Operand is “offset” from the (PC) ) • Base + Offset (Base relative) (Operand is “offset” from the contents of a register) • Immediate (Operand is in the instruction) • Indirect (The “Operand” actually points to the real address – rather than being the operand)
The Instruction Cycle Steps (or phases): • Fetch Next Instruction from Memory (PC) (points to) next instruction PC (PC) + 1 • Decode Fetched Instruction • Evaluate Address (es) • Fetch Operand (s) • Execute Operation • Store Result (if specified)
LC-3 Memory Layout X 000 – x 2 FFF Operating System programs, tables, and data Generally off limits to programmer (Prog run in Supervisor mode) X 3000 – x. FDFF User Program Area shared by users like you (Run in non-supervisor mode) x. FE 00 – x. FFFF Device Register Addresses Pseudo memory used for input/output R 0 -R 7 Registers
- Slides: 11