240 likes | 379 Views
Instruction Sets Week 10. Computer Architecture. Review Keywords & Concepts. English words & ideas you must know: Assembly Language Machine Language Number of Addresses Types of Operands BCD (Binary Coded Decimal). What we will learn today. Review last class
E N D
Instruction Sets Week 10 Computer Architecture Computer Architecture
Review Keywords & Concepts • English words & ideas you must know: • Assembly Language • Machine Language • Number of Addresses • Types of Operands • BCD (Binary Coded Decimal) Computer Architecture
What we will learn today • Review last class • Instruction Sets: Characteristics • Types of Operations • Pentium and PowerPC Operation Types • Assembly Language • QUIZ Computer Architecture
Machine Instructions • Information required by CPU • Operation Code • Source Operand Reference • Result Operand Reference • Next Instruction reference Computer Architecture
Location of Operand Reference • Main Memory (or cache) a = b + c; (a, b, & c are all memory locations) • Register in CPU c++; (c = c + 1; number 1 may be stored in a register) • I/O Device Computer Architecture
Instruction Representation Assembly Language vs. Machine Language • Assembly language uses mnemonics add r1, y • Machine Language is binary (all 1’s & 0’s) 0110 - Opcode of 4 bits 000001 – Register 1 110111 – Address in memory for y Actual: 011000000110111 Computer Architecture
Instruction Types • Data Processing • Arithmetic Instructions • Logic Instructions • Data Storage • Store data into memory (from CPU) • Fetch data from memory (into CPU) • Data Movement • I/O Instructions • Control • Test Instructions (conditional / if statements) • Branch Instructions (go to or subroutine statements) Computer Architecture
Number of Addresses • Three address instructions sub y,a,b y a – b Subtract • Two address instructions move y,a y a Move sub y,b y y – b Subtract • One address instructions load ac,a ac a Load sub ac,b ac ac – b Subtract stor ac,y ac y Store Computer Architecture
Types of Operands • Addresses • Locations in main memory • Numbers • Integer (2’s complement) • Floating Point • Decimal (BCD – Binary Coded Decimal) • Characters • ASCII (American Standard Code for Information Interchange) • EBCDIC (Extended Binary Coded Decimal Interchange Code) • Unicode • Logical Data • True (1) / False (0) Computer Architecture
BCD – Binary Coded Decimal • Advantages • Store large integer numbers – up to 99 digits • Used for business applications (i.e. Cobol) • No rounding errors (<99 digits) • Disadvantages • Takes more memory • Slow to compute • Can be very slow if CPU does not support BCD arithmetic in hardware (must compute in software) Computer Architecture
Types of Operations • Data Transfer • Arithmetic • Logical • Conversion • I/O • System Control • Transfer of Control Computer Architecture
Data Transfer • Move – transfer from source to destination • Store – CPU to memory • Load (fetch) – memory to CPU • Exchange – swap contents of src & dest • Clear (reset) – set to all zero’s • Set – set to all one’s • Push – push onto a stack • Pop – pop off a stack Computer Architecture
Arithmetic • Add, Subtract, Multiply, Divide • Integers (signed & unsigned), floating point numbers, BCD • Absolute – take absolute (positive) value • Negate – take negative of a number • Increment – add 1 to operand • Decrement – subtract 1 from operand Computer Architecture
Logical • Basic Logical Operations • AND, OR, NOT, XOR • Masks • Logical shifts – left or right • Arithmetic shifts – left or right • Rotate Computer Architecture
Conversion • Change format of data • Decimal to binary • BCD binary • EBCDIC ASCII (IRA) Computer Architecture
Input / Output • Programmed I/O • Interrupt Driven I/O • DMA Computer Architecture
System Control • Special instructions • Can ONLY be executed in privileged mode Computer Architecture
Transfer of Control • Branch Instruction • Basically sets PC (Program counter) • Jump or ‘goto’ statement • Also, conditional branch (test instructions) • Skip Instructions • ex: ISZ – Increment-and-skip-if-zero • Procedure calls Computer Architecture
Procedure Call Instructions • Stacks • Call - Save State (push onto stack) • Save return address • Save registers • Return – Restore State (pop off stack) • Restore registers • Jump to return address Computer Architecture
Pentium & PowerPC Operation Types • MMX • Designed for Multi-media tasks • SIMD (single-instruction, multiple-data) • Parallel processing feature • Focused on video & audio data Computer Architecture
Byte order • Little-Endian vs. Big-Endian (pages 376-380) • Hexadecimal – 12345678 • Little-Endian • 78563412 • Big-Endian • 12345678 Computer Architecture
What you know now • Instructions Sets • Types of Operations • Pentium and PowerPC Operation Types • MMX • Assembly Language • Little-Endian vs. Big-Endian Computer Architecture
Reading • http://en.wikipedia.org/wiki/Assembly_language • http://en.wikipedia.org/wiki/Endianness Next Lecture • Instruction Formats Computer Architecture
HomeworkWeek 10 See webpage for homework assignment Computer Architecture