BME303_lecture10_1 - BME303 Intro. to Computing 1 Chapter...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: BME303 Intro. to Computing 1 Chapter 5: The LC-3 ISA of LC-3 Memory Registers Instruction set Opcodes Data types Addressing modes Condition codes Instructions ( machine language) Operate Data Movement Control LC3 Data Path Problem Language Machine (ISA) Architecture Algorithms Micro-architecture Circuits Devices Bottom Up BME303 Intro. to Computing 2 LC-3: Instruction Set Opcodes (total of 15) 1. Operate instructions: ADD, AND, NOT 2. Data movement instructions: LD, LDI, LDR, LEA, ST, STR, STI 3. Control instructions: BR, JSR/JSRR, JMP, RET/RTI, TRAP Opcode Operand(s) 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 1 1 1 0 0 1 0 0 0 0 1 1 0 BME303 Intro. to Computing 3 Condition Codes 3 single-bit registers, NZP (each: set to 1 or cleared to 0) N : value written was negative (NZP=100) Z : value written was zero (NZP=010) P : value written was positive (NZP=001) Affected each time any register is written Can two registers be written at once? Condition codes are read/used by conditional branch instructions BME303 Intro. to Computing 4 Condition Codes What is the value of NZP for the following instructions? Assume R1 = x0002 0001 010 001 1 0 0010 0001 011 001 1 1 1100 0001 100 001 0 00 011 BME303 Intro. to Computing 5 Condition Codes What is the value of NZP for the following instructions? Assume R1 = x0002 0001 010 001 1 0 0010 (ADD R2 R1 #2) 0001 011 001 1 1 1100 (ADD R3 R1 #-4) 0001 100 001 00 011 (ADD R4 R1 R3) BME303 Intro. to Computing 6 Condition Codes Using only one LC-3 instruction and without changing the contents of any register, how might you set the condition codes based on the value of R1? BME303 Intro. to Computing 7 Control Instruction Store number in R1 R1 + 1 Standard Sequential Program Halt ADD R1 to R2 Store number in R1 R1 + 1 R1 > 10? yes no Sequence is broken BME303 Intro. to Computing 8 Control Instructions Used to alter the sequence of instructions (by changing PC) Conditional Branch branch is taken if a specified condition is true offset is added to the PC to yield new PC else, the branch is not taken PC is not changed, points to the next sequential instruction Unconditional Branch (or Jump) always changes the PC TRAP changes PC to the first instruction in an OS service routine when routine is done, next instruction is executed BME303 Intro. to Computing 9 Branch: BR (PC-Relative) What happens if bits [11:9] are all zero? All one? BME303 Intro. to ComputingBME303 Intro....
View Full Document

This note was uploaded on 01/24/2010 for the course BME 303 taught by Professor Ren during the Fall '08 term at University of Texas at Austin.

Page1 / 25

BME303_lecture10_1 - BME303 Intro. to Computing 1 Chapter...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online