1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 1: Bits, bytes and a simple processor dr.ir. A.C. Verschueren.

Slides:



Advertisements
Similar presentations
CH10 Instruction Sets: Characteristics and Functions
Advertisements

Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
1 Lecture 3: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation.
INSTRUCTION SET ARCHITECTURES
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
Instruction Set Architecture & Design
TK 2633 Microprocessor & Interfacing
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Memory - Registers Instruction Sets
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
What is an instruction set?
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Computers Central Processor Unit. Basic Computer System MAIN MEMORY ALUCNTL..... BUS CONTROLLER Processor I/O moduleInterconnections BUS Memory.
Lecture 17 Today’s Lecture –Instruction formats Little versus big endian Internal storage in the CPU: stacks vs. registers Number of operands and instruction.
Instruction Set Design by Kip R. Irvine (c) Kip Irvine, All rights reserved. You may modify and copy this slide show for your personal use,
Machine Instruction Characteristics
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CS-334: Computer.
Computer Systems Organization CS 1428 Foundations of Computer Science.
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,
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
Computer Architecture and Organization
Computer Architecture EKT 422
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-2.ppt Modification date: March 23, Procedures Essential ingredient of high level.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
What is a program? A sequence of steps
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
Picoblaze Overview EENG Introduction 8-bit microcontroller for Xilinx devices Soft Core – Soft Processor 5% of the resources of spartan 3 (3S200.
Group # 3 Jorge Chavez Henry Diaz Janty Ghazi German Montenegro.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 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.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Computers’ Basic Organization
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
Assembly Language Programming of 8085
Architecture Review Instruction Set Architecture
Prof. Sirer CS 316 Cornell University
Computer Organization and Design
CENTRAL PROCESSING UNIT
Chapter 8 Central Processing Unit
ECEG-3202 Computer Architecture and Organization
Chapter 9 Instruction Sets: Characteristics and Functions
Central Processing Unit
ECEG-3202 Computer Architecture and Organization
Prof. Sirer CS 316 Cornell University
Introduction to Microprocessor Programming
CPU Structure CPU must:
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Computer Operation 6/22/2019.
Chapter 10 Instruction Sets: Characteristics and Functions
Presentation transcript:

1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 1: Bits, bytes and a simple processor dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital Information Systems

1/1/ / faculty of Electrical Engineering eindhoven university of technology Basic processor - bits to memories High-level program becomes 'machine code’ –Patterns of 1's and 0's (bits) stored in a memory... Data structures are made suitable for hardware –Bit patterns stored in a memory! 'word 0' 'word 1' 'word 2' 'word N' 'word N-1' Memory: 'address space' M M 'bits' '0' or '1' 'M' is power of 2: 4, 8 ('byte'), 16, 32 or 64 2 m values in each word 'M' is power of 2: 4, 8 ('byte'), 16, 32 or 64 2 m values in each word

1/1/ / faculty of Electrical Engineering eindhoven university of technology Addressing a memory The 'Central Processing Unit' (CPU) can access each memory word for reading or writing To select which memory word is accessed, an 'address' must be given Which consists itself out of a number of bits Addressable memory sizes are also a power of 2 !

1/1/ / faculty of Electrical Engineering eindhoven university of technology Address sizes: how much memory ? 'Standard' address sizes are: 16 bits:65536 words 20 bits:> 10 6 words (1 'MegaWord') 24 bits:> 16  10 6 words 32 bits:> 4  10 9 words (4 'GigaWords') 64 bits:> 2  words (unpronouncable) Large, fast, reliable and easy-to-use memories are expensive must use large, slow, unreliable and difficult-to-use ones 

1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory addressing problems Memory is generally addressed in 'bytes' (8 bits), while a word may contain more than one byte –Lowest bit(s) in address indicate the byte in a word –'Partial write' and 'data misalignment' problems ! 16 bits 8 bits16 bits must be kept intact! must be kept intact!

1/1/ / faculty of Electrical Engineering eindhoven university of technology Instruction and data sizes Instruction length may vary (in bytes or words) –When reading instruction, CPU must know at all times if more follows ! Data size may vary (characters, integers, strings...) –Actual size must be encoded in instruction or data itself

1/1/ / faculty of Electrical Engineering eindhoven university of technology Running a program: where are we ? The Central Processing Unit must keep track of it's location in the program –It uses an 'Instruction Pointer' (IP) to do so In general, the IP is incremented (IP  IP + 1) to point to the next instruction –The IP is also called 'Program Counter' (PC)

1/1/ / faculty of Electrical Engineering eindhoven university of technology Modifying the ‘program flow’ The IP should be loadable with a new value –Needed for IF..THEN..ELSE, CASE..OF, WHILE..DO, DO..UNTIL etcetera Unconditional 'jumps'(load IP always) Conditional 'jumps'(only load IP if test passes, IP  IP + 1 else) Direct address(IP  N) Relative address(IP  IP + N, N can be positive or negative) Calculated address(IP  JumpTable[i], for instance)

1/1/ / faculty of Electrical Engineering eindhoven university of technology Basic operations on data (1) An 'Arithmetic and Logic Unit' (ALU) performs the actual data operations Most operations use 2 input ('source') variables: 'Binary operations' –Arithmetic: Add, Subtract, Multiply, Divide –Logic: AND, OR, XOR –Comparing values is done with a subtract operation, discarding the result

1/1/ / faculty of Electrical Engineering eindhoven university of technology Basic operations on data (2) Compare may be in one instruction with conditional IP load –or set special 'flags' to indicate outcome (zero, carry) –or return special result word containing these flags 'Unary operations' have only 1 source variable –Arithmetic: Negate, Increment (+1), Decrement ( ‑ 1) –Logic: NOT –Move data unmodified from source to 'destination'

1/1/ / faculty of Electrical Engineering eindhoven university of technology The number of addresses in an instruction The maximum number of addresses stored in a single instruction classifies processors 3-address machine 1-address machine uses 'accumulator’ as implied source/destination ALU 'ACCU' ALU 2-address machine ALU ADD source ADD dest/srce1, srce2 ADD dest, srce1, srce2

1/1/ / faculty of Electrical Engineering eindhoven university of technology Getting around the memory ‘bottleneck’ Reading and writing the external memory takes a lot of time –Add a small memory ( words) onto same chip as ALU: 'registers' –Can be made as fast as the ALU itself and allow multiple concurrent read and write operations –Can be used as multiple accumulators  temporary storage for results

1/1/ / faculty of Electrical Engineering eindhoven university of technology More on registers Registers can be seen as small internal memory with short addresses –Allows powerful 3-address instructions on registers –May limit main memory accesses to data MOVE operations between registers and external memory The 'load/store' philosophy

1/1/ / faculty of Electrical Engineering eindhoven university of technology CISC machine basics Complex data structures require complex address calculations... 'Complex Instruction Set Computers' (CISC’s) specifiy address calculations and actual ALU operation in a single instruction –Uses optimised separate hardware to calculate addresses –Needs few registers to store addresses –Packs a lot of information in one complex instruction

1/1/ / faculty of Electrical Engineering eindhoven university of technology RISC machine basics 'Reduced Instruction Set Computers' (RISC’s) use normal ALU operations to calculate addresses in a register for load/store moves –The ALU cannot be used for normal operations during address calculations –Needs extra registers to store calculated addresses –Requires several (simple) instructions where a CISC needs only one

1/1/ / faculty of Electrical Engineering eindhoven university of technology Subroutines A high-level subroutine/function call is done with the CALL instruction Is a JUMP instruction which stores the location of the next instruction (the ‘return address’) –A single location does not allow nested subroutines –Fixed locations do not allow recursive subroutines –Using a Last-In-First-Out ('stack') memory to store return addresses removes these limitations

1/1/ / faculty of Electrical Engineering eindhoven university of technology Getting out of subroutines again The RET(urn) instruction loads the IP with the last stored return address...and 'pops the stack'...which uncovers the next-to-last return address working backwards in time !

1/1/ / faculty of Electrical Engineering eindhoven university of technology Using the ‘stack’ to hold data Also holds data during complex calculations –'PUSH’ data onto the stack to store –'POP' data from the stack to retrieve –Convenient: no need to know actual storage location, as long as PUSHes and POPs pair up correctly

1/1/ / faculty of Electrical Engineering eindhoven university of technology Basing a whole machine on the stack By using the top- and next-of-stack storage locations for ALU operands, we can build a 'stack machine' (start) Calculate (A+B)x(C–D) with a stack A push A A B push B A+B ADD A+B C push C A+B C D push D A+B C–D SUB (A+B)x(C-D) MUL pop result

1/1/ / faculty of Electrical Engineering eindhoven university of technology Stack implementations The actual stack can be implemented with special hardware on the CPU –Very fast (same speed as register set) –Severely limited in size (problematic for high-level programs) The stack can also be stored in main memory

1/1/ / faculty of Electrical Engineering eindhoven university of technology Stack implementation incompatibilities Use a (special) register: the 'stack pointer' (SP) Points to the current top-of-stack word OR Points to the next free word on the stack Growing down:PUSH/CALL decrements SP, POP/RET increments SP OR Growing up:PUSH/CALL increments SP, POP/RET decrements SP –This gives a total of FOUR different and incompatible memory stack formats !

1/1/ / faculty of Electrical Engineering eindhoven university of technology 3) 'Modified Harvard' architecture CPU 2) 'Harvard' architecture CPU 1) 'von Neumann' architecture Memory interconnections Different memory/processor interconnections exist, classifying computers further instructions data constants CPU instructions data 'constants' instructions data 'constants' ‘von Neumann bottleneck’