Register Transfer Language and Microoperations (Part 2)

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

REGISTER TRANSFER AND MICROOPERATIONS

CHAPTER 4: Register Transfer Language and Microoperations

Computer Organization (Autonomous)

REGISTER TRANSFER AND MICROOPERATIONS

Computer Architecture and Organization: L04: Micro-operations

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

COMPUTER ORGANIZATION

REGISTER TRANSFER LANGUAGE

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

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

Register Transfer and Micro-operations

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

Computer Organization and Design

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

Binary Adders: Half Adders and Full Adders

Chapter 4. Operations on Data

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

Chapter 4 Arithmetic Functions

Computer Architecture

UNIT I STRUCTURE OF COMPUTERS

Experiment 7 Arithmetic Circuits Design and Implementation

Arithmetic Operations

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

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

csitnepal Unit 3 Basic Computer Organization and Design

Chapter 3: part 3 Binary Subtraction

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

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

Chapter 4 Arithmetic

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

ECE331: Hardware Organization and Design

Arithmetic-logic units

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

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

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

Number System. Introduction. Decimal Numbers

GO - OPERATORS. This tutorial will explain the arithmetic, relational, logical, bitwise, assignment and other operators one by one.

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

Midterm Examination # 2 Wednesday, March 18, Duration of examination: 75 minutes

Computer Organization

Real Digital Problem Set #6

ECEN 468 Advanced Logic Design

COMPUTER ARCHITECTURE AND DIGITAL DESIGN

Arithmetic Logic Unit (ALU)

CSC 220: Computer Organization Unit 10 Arithmetic-logic units

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

Microcomputers. Outline. Number Systems and Digital Logic Review

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

TYPES OF INTERRUPTS: -

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

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

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

Submitted by 1

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

Combinational Logic Circuits

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

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

Computer Architecture Programming the Basic Computer

To design a 4-bit ALU To experimentally check the operation of the ALU

Department of Electrical Engineering McGill University ECSE 221 Introduction to Computer Engineering Assignment 2 Combinational Logic

ECE468 Computer Organization & Architecture. The Design Process & ALU Design

JAVA OPERATORS GENERAL

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

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

Introduction to Computer Science. Homework 1

Computer Organization and Levels of Abstraction

COMPUTER ARITHMETIC (Part 1)

C/C++ Programming Lecture 7 Name:

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

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

Darshan Institute of Engineering & Technology for Diploma Studies Unit - 1

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

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

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN

Introduction to Boole algebra. Binary algebra

Chapter 3: Dataflow Modeling

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

(+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)

Verilog Dataflow Modeling

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

GC03 Boolean Algebra

CS/COE 0447 Example Problems for Exam 2 Spring 2011

UNIT 3 ALU ORGANISATION

Representation of Numbers

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Chapter 4. Combinational Logic. Dr. Abu-Arqoub

Computer Organization and Levels of Abstraction

COMBINATIONAL LOGIC CIRCUITS

Lecture 10: Combinational Circuits

EGC221: Digital Logic Lab

OCR H446 A-Level Computer Science

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

Operators. Java operators are classified into three categories:

Basic Arithmetic (adding and subtracting)

Floating Point Arithmetic

Number representations

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

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

Transcription:

Register Transfer Language and Microoperations (Part 2) Adapted by Dr. Adel Ammar Computer Organization 1

MICROOPERATIONS Computer system microoperations are of four types: Register transfer microoperations Arithmetic microoperations Logic microoperations Shift microoperations Computer Organization 2

ARITHMETIC MICROOPERATIONS The basic arithmetic microoperations are Addition Subtraction Increment Decrement The additional arithmetic microoperations are Add with carry Subtract with borrow Transfer/Load etc. Computer Organization 3

SUMMARY OF TYPICAL ARITHMETIC MICROOPERATIONS R3 R1 + R2 R3 R1 - R2 R2 R2 R2 R2 + 1 R3 R1 + R2 + 1 R1 R1 + 1 R1 R1-1 Contents of R1 plus R2 transferred to R3 Contents of R1 minus R2 transferred to R3 Complement the contents of R2 2's complement the contents of R2 (negate) subtraction Increment Decrement Computer Organization 4

BINARY ADDER / SUBTRACTOR / INCREMENTER Binary Adder B3 FA A3 C3 B2 FA A2 C2 B1 FA A1 C1 B FA A C C4 S3 Binary Adder - Subtractor B3 A3 B2 S2 A2 B1 S1 A1 B S A M FA C3 FA C2 FA C1 FA C C4 S3 S2 S1 S A3 A2 A1 A 1 Binary Incrementer x HA y x HA y x HA y x HA y C S C S C S C S C4 S3 S2 S1 S Computer Organization 5

S1 S Cin Y Output Microoperation 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 Cin S1 S A X C B S1 S 1 2 3 4x1 MUX Y FA C1 D A1 X1 C1 B1 S1 S 1 2 3 4x1 MUX Y1 FA C2 D1 A2 X2 C2 B2 S1 S 1 2 3 4x1 MUX Y2 FA C3 D2 A3 X3 C3 B3 1 S1 S 1 2 3 4x1 MUX Y3 FA C4 D3 Cout Computer Organization 6

LOGIC MICROOPERATIONS Specify binary operations on the strings of bits in registers Logic microoperations are bit-wise operations, i.e., they work on the individual bits of data useful for bit manipulations on binary data useful for making logical decisions based on the bit value There are, in principle, 16 different logic functions that can be defined over two binary input variables A B F F 1 F 2 F 13 F 14 F 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 However, most systems only implement four of these AND ( ), OR ( ), XOR ( ), Complement/NOT The others can be created from combination of these Computer Organization 7

LIST OF LOGIC MICROOPERATIONS Truth tables for 16 functions of 2 variables and the corresponding 16 logic microoperations A 1 1 B 1 1 Boolean Function Micro- Operations Name F = F Clear 1 F1 = xy F A B AND 1 F2 = xy' F A B 1 1 F3 = x F A Transfer A 1 F4 = x'y F A B 1 1 F5 = y F B Transfer B 1 1 F6 = x y F A B Exclusive-OR 1 1 1 F7 = x + y F A B OR 1 F8 = (x + y)' F A B) NOR 1 1 F9 = (x y)' F (A B) Exclusive-NOR 1 1 F1 = y' F B Complement B 1 1 1 F11 = x + y' F A B 1 1 F12 = x' F A Complement A 1 1 1 F13 = x' + y F A B 1 1 1 F14 = (xy)' F (A B) NAND 1 1 1 1 F15 = 1 F all 1's Set to all 1's Computer Organization 8

HARDWARE IMPLEMENTATION OF LOGIC MICROOPERATIONS A i B i 1 4 X 1 MUX F i 2 3 Select S S 1 Function table S 1 S Output -operation F = A B AND 1 F = A B OR 1 F = A B XOR 1 1 F = A Complement Computer Organization 9

APPLICATIONS OF LOGIC MICROOPERATIONS Logic microoperations can be used to manipulate individual bits or a portion of a word in a register Consider the data in a register A. the bits of another register, B, will be used to modify the contents of A Selective-set A A + B Selective-complement A A B Selective-clear A A B Mask (Delete) A A B Clear A A B Insert A (A B) + C Compare A A B... Computer Organization 1

SELECTIVE SET In a selective set operation, the bit pattern in B is used to set certain bits in A 1 1 A t 1 1 B 1 1 1 A t+1 (A A + B) If a bit in B is set to 1, that same position in A gets set to 1, otherwise that bit in A keeps its previous value Computer Organization 11

SELECTIVE COMPLEMENT In a selective complement operation, the bit pattern in B is used to complement certain bits in A 1 1 A t 1 1 B 1 1 A t+1 (A A B) If a bit in B is set to 1, that same position in A gets complemented from its original value, otherwise it is unchanged Computer Organization 12

SELECTIVE CLEAR In a selective clear operation, the bit pattern in B is used to clear certain bits in A 1 1 A t 1 1 B 1 A t+1 (A A B ) If a bit in B is set to 1, that same position in A gets set to, otherwise it is unchanged Computer Organization 13

MASK OPERATION In a mask operation, the bit pattern in B is used to clear certain bits in A 1 1 A t 1 1 B 1 A t+1 (A A B) If a bit in B is set to, that same position in A gets set to, otherwise it is unchanged Computer Organization 14

CLEAR OPERATION In a clear operation, if the bits in the same position in A and B are the same, they are cleared in A, otherwise they are set in A 1 1 A t 1 1 B 1 1 A t+1 (A A B) Computer Organization 15

INSERT OPERATION An insert operation is used to introduce a specific bit pattern into A register, leaving the other bit positions unchanged This is done as A mask operation to clear the desired bit positions, followed by An OR operation to introduce the new bits into the desired positions Example Suppose you wanted to introduce 11 into the low order four bits of A: 111 1 111 1 A (Original) 111 1 111 11 A (Desired) 111 1 111 1 A (Original) 1111 1111 1111 Mask 111 1 111 A (Intermediate) 11 Added bits 111 1 111 11 A (Desired) Computer Organization 16

SHIFT MICROOPERATIONS There are three types of shifts Logical shift Circular shift Arithmetic shift What differentiates them is the information that goes into the serial input A right shift operation Serial input A left shift operation Serial input Computer Organization 17

LOGICAL SHIFT In a logical shift the serial input to the shift is a. A right logical shift operation: A left logical shift operation: In a Register Transfer Language, the following notation is used shl for a logical shift left shr for a logical shift right Examples: R2 shr R2 R3 shl R3 Computer Organization 18

CIRCULAR SHIFT In a circular shift the serial input is the bit that is shifted out of the other end of the register. A right circular shift operation: A left circular shift operation: In a RTL, the following notation is used cil for a circular shift left cir for a circular shift right Examples: R2 cir R2 R3 cil R3 Computer Organization 19

ARITHMETIC SHIFT An arithmetic shift is meant for signed binary numbers (integer) An arithmetic left shift multiplies a signed number by two An arithmetic right shift divides a signed number by two The main distinction of an arithmetic shift is that it must keep the sign of the number the same as it performs the multiplication or division A right arithmetic shift operation: sign bit A left arithmetic shift operation: sign bit Computer Organization 2

ARITHMETIC SHIFT A left arithmetic shift operation must be checked for the overflow sign bit V Before the shift, if the leftmost two bits differ, the shift will result in an overflow In a RTL, the following notation is used ashl for an arithmetic shift left ashr for an arithmetic shift right Examples: R2 ashr R2 R3 ashl R3 Computer Organization 21

HARDWARE IMPLEMENTATION OF SHIFT MICROOPERATIONS Serial input (I R ) Select for shift right (down) 1 for shift left (up) S 1 MUX H A A1 A2 S 1 MUX H1 A3 S 1 MUX H2 S 1 MUX H3 Serial input (I L ) Computer Organization 22

S3 S2 S1 S Cin Operation Function F = A Transfer A 1 F = A + 1 Increment A 1 F = A + B Addition 1 1 F = A + B + 1 Add with carry 1 F = A + B Subtract with borrow 1 1 F = A + B + 1 Subtraction 1 1 F = A - 1 Decrement A 1 1 1 F = A Transfer A 1 X F = A B AND 1 1 X F = A B OR 1 1 X F = A B XOR 1 1 1 X F = A Complement A 1 X X X F = shr A Shift right A into F 1 1 X X X F = shl A Shift left A into F ARITHMETIC LOGIC SHIFT UNIT S3 S2 S1 S C i Arithmetic Circuit D i Select 4 x 1 C i+1 1 MUX F i 2 3 B i A i A i-1 A i+1 Logic Circuit E i shr shl Computer Organization 23

ANNOUNCEMENTS Readings Chapter 4 of the textbook: Computer System Architecture, M. Mano 4-2, 4-6, 4-7, 4-19, 4-2, 4-23 Computer Organization 24