Embedded Systems: Hardware Computer Processor Basics ISA (Instruction Set Architecture) RTL (Register Transfer Language) Main reference: Peckol, Chapter.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Instruction Set Design
Goal: Write Programs in Assembly
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
INSTRUCTION SET ARCHITECTURES
Computer Organization and Architecture
Instruction Set Architecture
Computer Organization and Architecture
Embedded Systems: Hardware Computer Processor Basics ISA (Instruction Set Architecture) RTL (Register Transfer Language) Main reference: Peckol, Chapter.
Instruction Set Architecture & Design
TK 2633 Microprocessor & Interfacing
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
By Tien Phung CS 147 Dr. Sin-Min Lee. High-level Languages Assembly Languages Machine Languages.
Memory - Registers Instruction Sets
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Choice for the rest of the semester New Plan –assembler and machine language –Operating systems Process scheduling Memory management File system Optimization.
What is an instruction set?
Computer Architecture
1 Instructions and Addressing
Computer Arithmetic Integers: signed / unsigned (can overflow) Fixed point (can overflow) Floating point (can overflow, underflow) (Boolean / Character)
(6.1) Central Processing Unit Architecture  Architecture overview  Machine organization – von Neumann  Speeding up CPU operations – multiple registers.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
Machine Instruction Characteristics
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Chapter 1 An Introduction to Processor Design 부산대학교 컴퓨터공학과.
Housekeeping 1.teams—end of class 2.Example verilog code (alter) 3.Example altera report 4.Lab Monday: you will be asked to show: -- one or more reports.
CS 147 June 13, 2001 Levels of Programming Languages Svetlana Velyutina.
ECE 456 Computer Architecture
Chapter 2-2 Assembly Instructions Number Systems Number Systems Assembly Instructions Assembly Instructions Branch Branch Next Lecture Next Lecture  Addressing.
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
Lecture 14 Today’s topics MARIE Architecture Registers Buses
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
Computer Architecture and Organization
I/O Memory Reg File ALU Program Counter Instruction Register Control Interconnect Control 1)PC contains mem address of Instruction, 2)From memory, instr.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
Computer Architecture EKT 422
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE Lecture 21 & 22 Processor Organization Register Organization Course Instructor: Engr. Aisha Danish.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
What is a program? A sequence of steps
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Instruction Sets. Instruction set It is a list of all instructions that a processor can execute. It is a list of all instructions that a processor can.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
CSC 221 Computer Organization and Assembly Language Lecture 06: Machine Instruction Characteristics.
1 Instructions and Addressing Course website:
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Instruction sets : Addressing modes and Formats
Control Unit Lecture 6.
System Programming and administration
A Closer Look at Instruction Set Architectures: Expanding Opcodes
THE sic mACHINE CSCI/CMPE 3334 David Egle.
The University of Adelaide, School of Computer Science
Chapter 8 Central Processing Unit
MARIE: An Introduction to a Simple Computer
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
Introduction to Microprocessor Programming
Chapter 6 Programming the basic computer
COMPUTER ORGANIZATION AND ARCHITECTURE
Computer Architecture Assembly Language
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

Embedded Systems: Hardware Computer Processor Basics ISA (Instruction Set Architecture) RTL (Register Transfer Language) Main reference: Peckol, Chapter 1 Fig

ISA: Categories: busing structure data types, size, representation instructions length, format(s) operator, # operands, address mode instruction types arithmetic / logical data movement, including I/O control function and procedure calls: stack?

fig_01_01 Basic components Common bus structure: address, data, control fig_01_03

fig_01_05 Some processor options (note firmware) DSP (A/D, D/A; high speed—video, audio, images 2. Microcontroller-based system Fig components integrated into one unit) 1. Microprocessor- based system fig_01_06 fig_01_07

fig_01_08 DATA: DATA TYPES NUMERIC --Unsigned integer --Signed integer (2’s complement, sign-magnitude, fixed point, etc.) --Floating point: 3 components: sign exponent mantissa NONNUMERIC --address --character

Numeric data 1.Range is always limited. Number of digits of resolution is size of fractional part. Example: in 4 numeric bits: Number of bits in fractionrange 0 (integer)0-15 1: xxx.x0-7.5 (fractions 0, ½) 2: xx.xx (fractions, 0, ¼, ½, ¾) 3: x.xxx (fractions, 0, 1/8, ¼, 3/8, ½, 5/8, ¾, 7/8)

fig_01_09 Most base 10 fractions cannot be represented exactly in binary: Example: how to represent 2.x in 4 bits, with 2 bits of resolution? Choices: 2.0, 2.25, 2.5, 2.75,  2.0 or  2.0 or  2.0 or 2.25 or 2.5 truncation rounding down rounding up r roundingtruncation Error range for n bits of resolution: Truncation: -2 -n < E truncation < 0 Rounding: - ½ 2 -n < E rounding < ½ 2 -n Computation: which is easier to compute?

Error propagation in arithmetic: Examples: Consider two numbers whose true values are N 1 and N 2 and whose values in the computing system are N 1E and N 2E Addition: errors add:N 1E = N 1 + E 1 N 2E = N 2 + E 2 N 1E + N 2E = (N 1 + E 1 ) + (N 2 + E 2 ) = N 1 + N 2 + E 1 + E 2 Multiplication: error : N 1E * N 2E = (N 1 + E 1 ) * (N 1 + E 2 ) = (N 1 N 2 ) + (N 2 * E 1 + N 1 * E 2 ) + (E 1 * E 2 ) term 1term 2 Note that if term 2 is neglected then error depends on size of N 1 and N 2

fig_01_10 Another example (pp of text): measuring power dissipated in resistor R in the following circuit: Suppose E = 100 VDC +/- 1%, I = 10A +/- 1%, R = 10 ohms +/- 1%. 3 methods of calculating power dissipated, neglecting lower order error terms: a. E1 = (100V +/- 1%) * (10A +/- 1%) =  b. I 2 R = (10A +/- 1%) * (10A +/- 1%) * (10 ohms +/- 1%) = 997  1003 c. E3 = (100 V +/- 1%)*(100 V +/- 1%) / (10 ohms +/- 1%) =  Which should we use? “optimistic”: a “middle-of-the-road”: average of a,b,c “safest”: c

Instructions—ISA level Instruction coding: HLL (high level language, C, C++, e.g.)  assembly language (ISA)  machine language (can work at any level; high level allows faster but less efficient coding) IEEE Standard —IEEE standard for microprocessor assembly language—used for examples in text

Instruction coding: Fields: operator, operands (type of addressing) Example: 32 bits 3 bits: opcode 2 bits: address mode (e.g. direct, indirect, indexed, immediate) 27 bits: for addressing operand (s) Expanding opcode (example): xxxx…xxx: 2 operands 1110xxx…xxx: 1 operand 1111xxx…xxx: no operand (e.g., HALT) operator addr mode operand(s)

fig_01_13 fig_01_14 fig_01_15 Example instruction formats

Instructions Instruction types: arithmetic / logical data movement control Arithmetic / logical instructions: operator; number of operands; arity (unary, binary, three-operand, …) Examples: x = -x negation, assignment x = yassignment x = x + yaddition, assignment z = x + yaddition, assignment

fig_01_42 Typical ALU and registers

fig_01_43 Common ALU functions Cannot be affected by interrupt

fig_01_44 Common ALU functions (continued)

fig_01_45 Common ALU functions (continued) Question: what is a minimal set of ALU instructions?

fig_01_16 Data movement instructions: source / destination

fig_01_17 Common data movement instructions Question: how can you implement XCH without using a temporary variable?

fig_01_12 Addressing modes: Immediate: MOVE A, #BH; Direct:MOVE OPR1, OPR2; Indirect:MOVE OPR1, *myVarPtr; MOVE *OPR1, *OPR1; MOVE *OPR1, **yPtr; Register direct:MOVE Reg1, Reg2; Register indirect:MOVE Reg1, *Reg2; Indexed (loops):MOVE Reg1, OPR2[REG2]; PC relative (loops,e.g.; offset can be negative): ADD PC, [Reg1]; Example: what is the difference between Y, *Y, **Y Indirect addressing— myVarPtr holds address or myVar

fig_01_21 Addressing examples:

fig_01_22

fig_01_23

fig_01_24

Control instructions Control can be: sequential (default) loop (pre or posttest) branch: go to conditional (if, if-else,, case, branch on condition) procedure or function call [interrupt or exception] change in control flow, e.g., I/O device ready Unusual event, e.g., overflow or undefined instruction

fig_01_29 Branch instructions Typical condition codes Typical branch instructions: fig_01_30

fig_01_31 Example of conditional statements: C / assembly language: fig_01_32

fig_01_34 Looping: example fig_01_35

fig_01_36 fig_01_37 Function or procedure call: Must store return address, pass information back and forth What are standard parameter passing methods?

fig_01_39 Stack: common way to handle procedure / function calls Q: what are two alternative methods for handling function / procedure calls? Which methods facilitate recursion?

fig_01_40 Function call: example: fig_01_41

Question: can you design a “general-purpose computer” with a 3-bit opcode?

fig_01_46 Different viewpoint: RTL: register-transfer language level

fig_01_49 Register behavior: Read / Write; Serial / Parallel fig_01_50 fig_01_51

fig_01_52 RTL VIEW fig_01_53

fig_01_54 fig_01_55 Instruction execution cycle Q: Where is this step implemented?

fig_01_57 Multiple levels--examples

fig_01_58

fig_01_59

table_01_03

Project 1: build a simple processor (bit-slice design) Von Neumann architecture Only one general purpose register (accumulator) Supports direct, indirect, and indexed addressing Small instruction set, 2 formats ( or 111) Primitive I/O (via accumulator) Word addressable, 18-bit word Addressing direct, indirect, indexed by A or by B I/O to and from accumulator or a special- purpose register ALU M MA IRACCFMDIAIBPC ABUS OBUS BBUS ALU OUTPUT M: memory MA: memory address register MD: memory data register IR: instruction register AC: accumulator CF: carry flag IA, IB: index registers (13 bit) PC: program counter Instruction format: Op code (3) Addr Mode (2) Address (13) Functionality: 2's complement add, subtract, multiply, and divide, and, or, not jumps (conditional and unconditional), simple subroutine call and return Interrupts I/O Minimal hardware resources  high degree of functionality