Computer Architecture and Organization: L04: Micro-operations

Similar documents
Register Transfer Language and Microoperations (Part 2)

REGISTER TRANSFER LANGUAGE

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

REGISTER TRANSFER AND MICROOPERATIONS

CHAPTER 4: Register Transfer Language and Microoperations

REGISTER TRANSFER AND MICROOPERATIONS

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

Computer Organization (Autonomous)

For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

Register Transfer and Micro-operations

Computer Architecture and Organization: L09: CPU Organization

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

COMPUTER ORGANIZATION

The operations executed on data stored in registers(shift, clear, load, count)

Chapter 3: part 3 Binary Subtraction

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

Computer Organization and Design

Chapter 4. Operations on Data

Computer Architecture and Organization: L06: Instruction Cycle

An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit

Arithmetic Circuits. Design of Digital Circuits 2014 Srdjan Capkun Frank K. Gürkaynak.

Experiment 7 Arithmetic Circuits Design and Implementation

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

Chapter 4 Arithmetic

Chapter 4 Arithmetic Functions

TYPES OF INTERRUPTS: -

Arithmetic Logic Unit. Digital Computer Design

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

UNIT I STRUCTURE OF COMPUTERS

Computer Architecture

Let s put together a Manual Processor

COMP 303 Computer Architecture Lecture 6

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

Arithmetic Logic Unit (ALU)

Week 6: Processor Components

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

Computer Organization

Number System. Introduction. Decimal Numbers

10-1 C D Pearson Education, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 4e

Chapter 5. Computer Architecture Organization and Design. Computer System Architecture Database Lab, SANGJI University

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

Arithmetic-logic units

C.P.U Organization. Memory Unit. Central Processing Unit (C.P.U) Input-Output Processor (IOP) Figure (1) Digital Computer Block Diagram

CHAPTER 8: Central Processing Unit (CPU)

csitnepal Unit 3 Basic Computer Organization and Design

Arithmetic Operations

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs

ALU Design. 1-bit Full Adder 4-bit Arithmetic circuits. Arithmetic and Logic Unit Flags. Add/Subtract/Increament/Decrement Circuit

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

Arithmetic Logic Unit

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

Combinational Logic Circuits

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Lecture 9. INC and DEC. INC/DEC Examples ADD. ADD Examples SUB. INC adds one to a single operand DEC decrements one from a single operand

Binary Adders: Half Adders and Full Adders

ECE331: Hardware Organization and Design

CS 24: INTRODUCTION TO. Spring 2015 Lecture 2 COMPUTING SYSTEMS

Chapter 4. Combinational Logic

Course Description: This course includes concepts of instruction set architecture,

COA. Prepared By: Dhaval R. Patel Page 1. Q.1 Define MBR.

Introduction to Boole algebra. Binary algebra

Parallel logic circuits

Two-Level CLA for 4-bit Adder. Two-Level CLA for 4-bit Adder. Two-Level CLA for 16-bit Adder. A Closer Look at CLA Delay

Logic Instructions. Basic Logic Instructions (AND, OR, XOR, TEST, NOT, NEG) Shift and Rotate instructions (SHL, SAL, SHR, SAR) Segment 4A

Real Digital Problem Set #6

TABLE 9-1. Symbolic Convention for Addressing Modes. Register indirect LDA (R1) ACC M[ R1] Refers to Figure 9-4. Addressing mode. Symbolic convention

COMPUTER ARITHMETIC (Part 1)

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

Microcomputers. Outline. Number Systems and Digital Logic Review

EKT 422/4 COMPUTER ARCHITECTURE. MINI PROJECT : Design of an Arithmetic Logic Unit

Computer Organisation CS303

M. Sc (CS) (II Semester) Examination, Subject: Computer System Architecture Paper Code: M.Sc-CS-203. Time: Three Hours] [Maximum Marks: 60

Review. Steps to writing (stateless) circuits: Create a logic function (one per output)

CPE300: Digital System Architecture and Design

Advanced Computer Architecture-CS501

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

LECTURE 4. Logic Design

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

EE 109 Unit 6 Binary Arithmetic

EECS150 - Digital Design Lecture 13 - Combinational Logic & Arithmetic Circuits Part 3

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle

Midterm Project Design of 4 Bit ALU Fall 2001

CS222: Processor Design

Basic Arithmetic (adding and subtracting)

Revision: August 31, E Main Suite D Pullman, WA (509) Voice and Fax

Chapter 4. Combinational Logic. Dr. Abu-Arqoub

Binary Arithmetic. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T.

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

8086 INTERNAL ARCHITECTURE

EEM336 Microprocessors I. Arithmetic and Logic Instructions

Module 2: Computer Arithmetic

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN

Outline. EEL-4713 Computer Architecture Multipliers and shifters. Deriving requirements of ALU. MIPS arithmetic instructions

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

CHAPTER 6 ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS

Note that none of the above MAY be a VALID ANSWER.

Computer Architecture Programming the Basic Computer

Introduction to Computer Science. Homework 1

Transcription:

Computer Architecture and Organization: L4: Micro-operations By: A. H. Abdul Hafez Abdul.hafez@hku.edu.tr, ah.abdulhafez@gmail.com, hafez@research.iiit.ac.in 1

Outlines 1. Arithmetic microoperation 2. Full adder 3. Four bit parallel adder 4. Adder subtractor circuit 5. Four bits arithmetic circuit 6. One stage logic unite 7. Logic microoperation example 8. Shift microoperation 1. Logic shift 2. Circular shift 3. Arithmetic shift 9. Shift unit 1. ALU 11. End 2

Main Types of Microoperations in Digital Computers 1. Register Transfer Microoperations transfer binary information from one register to another. 2. Arithmetic Microoperations perform arithmetic operations on numeric data stored in registers. 3. Logic Microoperations perform bit manipulation operations on (non-numeric) data stored in registers. 4. Shift Microoperations perform shift operations on data stored in registers. 3

Arithmetic Microoperations Symbolic Designation R3 R1 + R2 R3 R1 R2 R2 R 2 R2 R 2 + 1 Description Contents of R1 plus R2 transferred to R3 Contents of R1 minus R2 transferred to R3 Complement of the contents of R2 (1 s complement) 2 s complement of the contents of R2 R3 R1 + R 2 + 1 R1 plus the 2 s complement of R2 (subtraction) R1 R1 + 1 R1 R1-1 Increment the contents of R1 by one Decrement the contents of R1 by one 4

The full Adder Half Adder x y c s 1 1 1 1 1 1 1 c = xy s = xy + x y = x y x y c s Full Adder x y c n-1 c n s 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 x y c n-1 S c n 5

The full Adder The full adder accepts two input bits and an input carry and generates a sum output and an output carry A B C in C out 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 6

Four-bits parallel adder 7

2 s complement form A negative value is the 2 s complement of the corresponding positive value. 8

Binary adder-subtractor B 3 A 3 A 2 A 1 B B 2 B 1 A M= Add M=1 Subtract M C 4 FA C 3 C 2 C 1 FA FA FA C S 3 S 2 S 1 S 9

C in 4-bit Arithmetic Circuit A X S 1 S B 1 1 2 3 S 1 S 4x1 MUX Y C FA C 1 D A 1 X 1 The output of the circuit is represented by the expression: D= A + Y + C in The value of Y is depend on the value of the selector lines. B 1 1 1 2 3 1 2 3 S 1 S S 1 S 4x1 MUX A 2 X 2 B 2 1 4x1 MUX A 3 X 3 Y 1 Y 2 FA C 2 FA C 3 D 1 D 2 1 CAO, by Dr. A.H. Abdul Hafez, CE Dept. HKU 1 B 3 1 2 3 S 1 S 4x1 Y MUX 3 FA C 4 D 3 C out

Select Input Output Microoperation S 1 S C in Y D = A + Y + C in B D = A + B Add 1 B D = A + B + 1 Add with carry 1 B D = A + B Subtract with borrow 1 1 B D = A + B + 1 Subtract 1 D = A Transfer A 1 1 D = A + 1 Increment A 1 1 1 D = A - 1 Decrement A 1 1 1 1 D = A Transfer A Arithmetic Circuit Function Table 11

Logic Microoperations 12

One Stage Logic Circuit S 1 S A i B i 1 4x1 MUX E i S S Output Operation 2 1 E = A B AND 3 1 E = A B OR 1 E = A B XOR 1 1 E = A Complement

Logic microoperation Examples Selective set Selective clear Selective complement Mask Compare Insert 14

Selective Set Setting a bit is turning that bit on (making it 1) 1 1 1 11 Content of Register A before Microoperation 11 Content of Register B (Logic Operand) ------- 111 Content of Register A after Microoperation What is the logic function that performs the selective set micro-operation? A or B

Selective Clear Clearing a bit is turning that bit off (making it ) 1 11 A Before 11 B (Logic Operand) ------- 1 A after What is the logic function that performs the selective clear micro-operation? A and B

Selective Complement Complementing a bit is negating the bit 1 1 11 A Before 11 B (Logic Operand) ------- 11 A after What is the logic function that performs the selective complement micro-operation? A xor B

Mask (Select) Operation Masking a bit is selecting the bit if the mask bit is 1 Mask bit = 1, 1 1 Mask bit = 1, 11 A Before 11 B (Mask) ------- 1 A after What is the logic function that performs the mask micro-operation? A and B

Compare Microoperation A A B 11 A 11 B ------- A A B

Insert Microoperation Inserting a group of bits into one part of a register e.g. insert 11 into the most significant nibble of a register Microoperation 1 11 11 A Before 1111 B (mask) ------- 11 A after Step no.1 Masking (A And B) Microoperation 2 11 A Before 11 B (insert) ------- 11 11 A after Step No.2 (A OR B)

Shift microoperations 1. Logical shift : transfers through the serial input R2 shr R2 7 R1 shl R1 7 Logical Shift 2. Circular shift : circulates the bits around the two ends without loss the information. R1 cil R1 R2 cir R2 7 7 Circular Shift (Rotate) 21

Shift microoperations 3. Arithmetic shift: shifts a signed binary number to the left or to the right. The sign bit must not changed because the sign of the number remains the same. R ashr R 7 Arithmetic Shift Right (Divide by 2) -8 4 2 1-8 4 2 1 Before 1 1 Before 1 1 After 1 1 After 1 1 1 Positive Numbers Negative Numbers 22

Shift microoperations 3. Arithmetic shift: shifts a signed binary number to the left or to the right. The sign bit may be changed. R ashl R 7-8 4 2 1 Arithmetic Shift Left (Multiply by 2) -8 4 2 1 Before 1 Before 1 1 After 1 No Overflow After 1 1 Overflow! Overflow occurs if, before the shift, V s = R 3 R 2 23 V s = R n-1 R n-2

4-bits combinational circuit shifter 24

Arithmetic logic shift unit ALU 25

Function Table for Arithmetic Logic Shift Unit 26

The end of the Lecture Thanks for your time Questions are welcome 27