ARITHMETIC LOGIC SHIFT UNIT

Slides:



Advertisements
Similar presentations
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
Advertisements

Chapter 4 Register Transfer and Microoperations
Chapter 7 Henry Hexmoor Registers and RTL
M. Mateen Yaqoob The University of Lahore Spring 2014.
PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
1 Register Transfer &  -operations Computer Organization Computer Architectures Lab REGISTER TRANSFER AND MICROOPERATIONS Register Transfer Language Register.
Computer Organization and Architecture
Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Computer System Architecture ESGD2204
Lecture 16 Today’s topics: –MARIE Instruction Decoding and Control –Hardwired control –Micro-programmed control 1.
Chapter 4 MARIE: An Introduction to a Simple Computer.
CPU Design. Introduction – The CPU must perform three main tasks: Communication with memory – Fetching Instructions – Fetching and storing data Interpretation.
Chapter 4 The Von Neumann Model
Computer Architecture Lecture 09 Fasih ur Rehman.
Exam2 Review Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Chapter 8: The Very Simple Computer
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
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.
M. Mateen Yaqoob The University of Lahore Spring 2014.
Lec 5 Basic Computer Organization
CoE3DJ4 Digital Systems Design
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
M. Mateen Yaqoob The University of Lahore Spring 2014
CSE 241 Computer Organization Lecture # 8 Ch. 7 Control Unit Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Instruction.
Register Transfer Languages (RTL)
Ch5. 기본 컴퓨터의 구조와 설계.
Chapter 4 Register Transfer and Microoperations Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2010.
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
GROUP 2 CHAPTER 16 CONTROL UNIT Group Members ๏ Evelio L. Hernandez ๏ Ashwin Soerdien ๏ Andrew Keiper ๏ Hermes Andino.
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
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.
8085 processor.
Control Unit Operations Chapter10:. What is Control Unit (CU)?(1)  Part of a CPU or other device that directs its operation.  Tells the rest of the.
Chapter 10 Control Unit Operation “Controls the operation of the processor”
Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.
Basic Computer The following discussions are based on a fictitious computer called “Basic Computer” by the author of the textbook It’s a much better way.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
1 Register Transfer and Microoperations Acknowledgment: Most of the slides are adapted from Prof. Hyunsoo Yoon’s slides.
Chapter 5 Computer Organization TIT 304/TCS 303. Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
Basic Computer Organization and Design
Basic Processor Structure/design
Chapter 4 Register Transfer and Microoperations
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Symbol Hex Code Description I=0 I=1
Chap 7. Register Transfers and Datapaths
Chapter 4 The Von Neumann Model
ADVANCED PROCESSOR ARCHITECTURE
Computer Organization and Design
BASIC COMPUTER ORGANIZATION AND DESIGN
Chapter 4 The Von Neumann Model
BASIC COMPUTER ORGANIZATION AND DESIGN
The Processor and Machine Language
BASIC COMPUTER ORGANIZATION AND DESIGN
By: A. H. Abdul Hafez CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU
Instruction and Control II
Fundamental Concepts Processor fetches one instruction at a time and perform the operation specified. Instructions are fetched from successive memory locations.
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Chapter 4 The Von Neumann Model
The Stored Program Computer
A Top-Level View Of Computer Function And Interconnection
UNIT – III Microprogrammed Control
Presentation transcript:

ARITHMETIC LOGIC SHIFT UNIT Shift Microoperations ARITHMETIC LOGIC SHIFT UNIT S3 S2 C i S1 S0 Arithmetic D i Circuit Select 4 x 1 C F i+1 1 MUX i 2 3 Logic E i B i Circuit A i shr A i-1 A shl i+1 S3 S2 S1 S0 Cin Operation Function 0 0 0 0 0 F = A Transfer A 0 0 0 0 1 F = A + 1 Increment A 0 0 0 1 0 F = A + B Addition 0 0 0 1 1 F = A + B + 1 Add with carry 0 0 1 0 0 F = A + B’ Subtract with borrow 0 0 1 0 1 F = A + B’+ 1 Subtraction 0 0 1 1 0 F = A - 1 Decrement A 0 0 1 1 1 F = A TransferA 0 1 0 0 X F = A  B AND 0 1 0 1 X F = A B OR 0 1 1 0 X F = A  B XOR 0 1 1 1 X F = A’ Complement A 1 0 X X X F = shr A Shift right A into F 1 1 X X X F = shl A Shift left A into F

BASIC COMPUTER REGISTERS Registers in the Basic Computer 11 PC Memory 11 4096 x 16 AR 15 IR CPU 15 15 TR DR 7 7 15 OUTR INPR AC List of Registers DR 16 Data Register Holds memory operand AR 12 Address Register Holds address for memory AC 16 Accumulator Processor register IR 16 Instruction Register Holds instruction code PC 12 Program Counter Holds address of instruction TR 16 Temporary Register Holds temporary data INPR 8 Input Register Holds input character OUTR 8 Output Register Holds output character

Fundamental Concepts Processor fetches one instruction at a time and perform the operation specified. Instructions are fetched from successive memory locations until a branch or a jump instruction is encountered. Processor keeps track of the address of the memory location containing the next instruction to be fetched using Program Counter (PC). Instruction Register (IR) Mr. Mukul Varshney

Instruction codes PROCESSOR REGISTERS A processor has many registers to hold instructions, addresses, data, etc The processor has a register, the Program Counter (PC) that holds the memory address of the next instruction Since the memory in the Basic Computer only has 4096 locations, the PC only needs 12 bits In a direct or indirect addressing, the processor needs to keep track of what locations in memory it is addressing: The Address Register (AR) is used for this The AR is a 12 bit register in the Basic Computer When an operand is found, using either direct or indirect addressing, it is placed in the Data Register (DR). The processor then uses this value as data for its operation The Basic Computer has a single general purpose register – the Accumulator (AC)

Instruction codes PROCESSOR REGISTERS The significance of a general purpose register is that it can be used for loading operands and storing results e.g. load AC with the contents of a specific memory location; store the contents of AC into a specified memory location Often a processor will need a scratch register to store intermediate results or other temporary data; in the Basic Computer this is the Temporary Register (TR) The Basic Computer uses a very simple model of input/output (I/O) operations Input devices are considered to send 8 bits of character data to the processor The processor can send 8 bits of character data to output devices The Input Register (INPR) holds an 8 bit character gotten from an input device The Output Register (OUTR) holds an 8 bit character to be send to an output device

Instruction Format A computer usually have a variety of instruction code formats. It is the function of control unit within the CPU to interpret each instruction code and provide the necessary control functions needed to process the instruction. The format of an instruction is depicted by a rectangular box. The bits of the instruction are divided into groups called fields. The most common fields found in instruction format are: 1) An operation code field that specifies the operation to be performed. 2) An address field that designates a memory address or a processor register. 3) A mode field that specifies the way the operands or the effective address is determined. Opcode Address Mode Mr. Mukul Varshney

5-3. Computer Instruction Instruction Code Formats : Memory-reference instruction Opcode = 000  110 Register-reference instruction Input-Output instruction , I=0 : Direct, I=1 : Indirect I Opcode Address 15 14 12 11 0 0 1 1 1 Register Operation 15 14 12 11 0 1 1 1 1 I/O Operation 15 14 12 11 0 Reading this table: the presented code is for any instruction that has 16 bits. The xxx represents don’t care ( any data for the first 12 bits). Example 7002 for is a hexadecimal code equivalent to 0111 0000 0000 0010 Which means B1 (Bit 1) is set to 1 and the rest of the first 12 bits are set to zeros.

Instruction cycle The control unit of a computer is designed to go through an instruction cycle that is divided into three major phases: 1) Fetch the instruction from memory 2) Decode the instruction 3) Execute the instruction PC holds the address of the instruction to be executed next and incremented each time an instruction is fetched from memory. The decoding determines the operation to be performed , the addressing modes and the location of the operands. The computer than executes the instruction Mr. Mukul Varshney

Instruction cycle The instruction execution cycle can be clearly divided into three different parts Fetch Cycle The fetch cycle takes the address required from memory, stores it in the instruction register, and moves the program counter on one so that it points to the next instruction. PC contains address of next instruction Address moved to MAR Address placed on address bus Control unit requests memory read Result placed on data bus, copied to MBR, then to IR Meanwhile PC incremented by 1 Decode Cycle Here, the control unit checks the instruction that is now stored within the instruction register. It determines which opcode and addressing mode have been used, and as such what actions need to be carried out in order to execute the instruction in question. Execute Cycle The actual actions which occur during the execute cycle of an instruction depend on both the instruction itself, and the addressing mode specified to be used to access the data that may be required Mr. Mukul Varshney

Instruction cycle • The fetch & decode phases of the instruction cycle consists of the following microoperations synchronized with the timing signals (clocking principle). Timing signal microoperations T0: AR ¬ PC T1: IR ¬ M[AR], PC ¬ PC + 1 T2: D0, ..., D7 ¬ Decode IR(12-14), AR ¬ IR(0-11), I ¬ IR(15) Mr. Mukul Varshney

1. Enable the read input of the memory. T0: Since only AR is connected to the address inputs of memory, the address of instruction is transferred from PC to AR. 1. Place the content of PC onto the bus by making the bus selection inputs S2S1S0 = 010. 2. Transfer the content of the bus to AR by enabling the LD input to AR ( AR ¬ PC). T1: The instruction read from memory is then placed in the instruction register IR. At the same time, PC is incremented to prepare for the address of the next instruction. 1. Enable the read input of the memory. 2. Place the content of memory onto the bus by making the bus selection inputs S2S1S0 = 111. (Note that the address lines are always connected to AR, and we have already placed the next instruction address in AR.) 3. Transfer the content of the bus to IR by enabling the LD input to IR (IR ¬ M[AR]). 4. Increment PC by enabling the INR input of PC ( PC ¬ PC + 1 ). T2: The operation code in IR is decoded; the indirect bit is transferred to I; the address part of the instruction is transferred to AR. (See the common bus skeleton diagram.) Mr. Mukul Varshney

Control function Microoperation Similar circuits are used to realize the microoperations at T2. • At T3, microoperations which take place depend on the type of instruction. The four different paths are symbolized as follows, where the control functions must be connected to the proper inputs to activate the desired microoperations. Control function Microoperation D7’IT3: AR ¬ M[AR], indirect memory transfer D7’I’T3: Nothing, direct memory transfer D7I’T3: Execute a register-reference instruction D7IT3: Execute an I/O instruction When D7’T3 = 1 (At T3 & IR(12-14) ¹ 111), the execution of memory-reference instructions takes place with the next timing variable T4. Mr. Mukul Varshney

Mr. Mukul Varshney