Submitted by 1

Similar documents

REGISTER TRANSFER LANGUAGE

Register Transfer Language and Microoperations (Part 2)

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

Let s put together a Manual Processor

VHDL Implementation of Arithmetic Logic Unit

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

COMBINATIONAL LOGIC CIRCUITS

Computer Architecture and Organization: L04: Micro-operations

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

Experiment 7 Arithmetic Circuits Design and Implementation

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

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

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

Combinational Logic with MSI and LSI

REGISTER TRANSFER AND MICROOPERATIONS

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

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 3 DLD P VIDYA SAGAR

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

CSC 220: Computer Organization Unit 10 Arithmetic-logic units

Chapter 4 Arithmetic Functions

Chapter 3: part 3 Binary Subtraction

Arithmetic-logic units

Computer Organization

EXPERIMENT NUMBER 11 REGISTERED ALU DESIGN

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

Software and Hardware

Basic Arithmetic (adding and subtracting)

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 09 MULTIPLEXERS

END-TERM EXAMINATION

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

CHAPTER 4: Register Transfer Language and Microoperations

CS 261 Fall Mike Lam, Professor. Combinational Circuits

Microcomputers. Outline. Number Systems and Digital Logic Review

Implementation of Low Power High Speed 32 bit ALU using FPGA

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

Von Neumann Architecture

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

Computer Organization (Autonomous)

Keywords: Soft Core Processor, Arithmetic and Logical Unit, Back End Implementation and Front End Implementation.

Dec Hex Bin ORG ; ZERO. Introduction To Computing

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

Chapter 4. Operations on Data

CS429: Computer Organization and Architecture

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

EGC221: Digital Logic Lab

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

ELCT 501: Digital System Design

Arithmetic Operations

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

Register Transfer and Micro-operations

Lecture (05) Boolean Algebra and Logic Gates

*Instruction Matters: Purdue Academic Course Transformation. Introduction to Digital System Design. Module 4 Arithmetic and Computer Logic Circuits

CS 31: Intro to Systems Digital Logic

Introduction to Boole algebra. Binary algebra

REGISTER TRANSFER AND MICROOPERATIONS

CS101 Lecture 25: The Machinery of Computation: Computer Architecture. John Magee 29 July 2013 Some material copyright Jones and Bartlett

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

ECE331: Hardware Organization and Design

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

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

UNIT I STRUCTURE OF COMPUTERS

EC2303-COMPUTER ARCHITECTURE AND ORGANIZATION

CS140 Lecture 03: The Machinery of Computation: Combinational Logic

Chapter 3. Gate-Level Minimization. Outlines

ECEN 468 Advanced Logic Design

1. Mark the correct statement(s)

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

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

Computer Organization and Levels of Abstraction

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

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

Parallel logic circuits

Chapter 4 Design of Function Specific Arithmetic Circuits

Lecture 10: Combinational Circuits

CHAPTER 9 MULTIPLEXERS, DECODERS, AND PROGRAMMABLE LOGIC DEVICES

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Arithmetic Logic Unit. Digital Computer Design

This paper is not to be removed from the Examination Halls

Computer Architecture

QUESTION BANK FOR TEST


Midterm Project Design of 4 Bit ALU Fall 2001

CAD4 The ALU Fall 2009 Assignment. Description

CS 105 Review Questions #3

CO Computer Architecture and Programming Languages CAPL. Lecture 9

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

Introduction to Digital Logic Missouri S&T University CPE 2210 Multipliers/Dividers

Digital Logic Design Exercises. Assignment 1

JAVA OPERATORS GENERAL

Week 6: Processor Components

Designing an Improved 64 Bit Arithmetic and Logical Unit for Digital Signaling Processing Purposes

Chapter 2 Logic Gates and Introduction to Computer Architecture

CC411: Introduction To Microprocessors

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers Implementation

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

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

ECE 274 Digital Logic. Digital Design. Datapath Components Subtractors, Two s Complement, Overflow, ALUs, Register Files Digital Design

How a Digital Binary Adder Operates

Transcription:

Submitted by WWW.ASSIGNMENTPOINT.COM 1

In computing, an Arithmetic Logic Unit (ALU) is a digital circuit that performs arithmetic and logical operations. The ALU is a fundamental building block of the central processing unit (CPU) of a computer, and even the simplest microprocessors contain one for purposes such as maintaining timers. Mathematician John von Neumann proposed the ALU concept in 1945, when he wrote a report on the foundations for a new computer called the Electronic Discrete Variable Automatic Computer (EDVAC). Research into ALU remains an important part of computer science, falling under arithmetic and logic structures in the ACM computing classification system. 1.2 Methodology: An Arithmetic logic unit system has been developed by sequence of operation. To achieve a successful ALU design we use following methodologies: Studying literature on different types of bit and their implementation. Studying the existing method for ALU arithmetic and logic operation. Analyzing and designing for the proposed system. Implementation of the desiring design of Arithmetic Logic Unit. 2

CHAPTER-2 How to Design an ALU 3

2.1 Arithmetic Logic Unit: An arithmetic logic unit (ALU) is a multi-operation, combinational-logic digital function. It can perform a set of basic arithmetic operations and set of logic operations. The ALU has a number of selection lines to select a particular operation in the unit. The four data inputs form A are combined with the four inputs from B to generate an operation at the F. The mode select inputs S 2 distinguish between arithmetic and logic operation. The two function select inputs S 1 and S 0 Specify particular arithmetic or logic operation to be granted. 2.2 Block Diagram of ALU: A B A 1 A 0 B 1 B 0 S 2 (Mode-Select) (Output Carry) C out S 1 S 0 (Function-select) C in (Input Carry) F Fig: 2.1 Block Diagram of a 2 bit ALU 4

Basic features of a 2-bit ALU: 1. This 2-bit ALU has been designed based on 8 arithmetic operations and four logic operations. At first, the circuit for 2-bit ALU has been simulated using Pspice software and then the simulated circuit is finally implemented on bread board. 2. Our purpose was to reduce the time delay. 3. We took a new attempt by using this 2-bit ALU by using the latest version of Pspice software where the full-adder is also designed by logic gate. 4. Despite their complexity, they are only logic. 5

Logic Gates: 2.3 NOT Gate: (1) Instruction Format: NOT Operand A (2) Function: Operand A is a input. This operator performs the bitwise NOT operation on Operand A. The truth table defines the behavior of each bit operation shown below: INPUT OUTPUT Fig: 2.2(i) NOT Gate A A Fig: 2.2(ii) NOT gate Truth Table 0 1 1 0 6

Fig: 2.2(iii) Inverter Switch Timing diagram of NOT gate: Fig: 2.2(iv) Timing Diagram of NOT Gate. 7

8

2.4 AND Gate: (1) Instruction Format: AND Operand A Operand B (2) Function: Operand A and Operand B are two inputs. This operator performs the bitwise AND operation, and put the result in F = X. Y The circuit symbol and truth table defines the behavior of each bit operation shown below: INPUT OUTPUT X Y X*Y 0 0 0 0 1 0 1 0 0 1 1 1 Fig: 2.3(i) AND Gate Fig: 2.3(ii) AND Gate Truth Table 9

Fig: 2.3(iii) CMOS AND Gate 10

Timing diagram of AND gate: Fig 2.3 (iv) Timing Diagram of AND gate 11

2.5 OR Gate: (1) Instruction Format: OR Operand A Operand B (2) Function: Operand A and Operand B are two 16 bits register inputs. This operator performs the bitwise OR operation, and put the result in F = X +Y. The truth table defines the behavior of each bit operation shown below: INPUT OUTPUT X Y X+Y 0 0 0 0 1 1 1 0 1 Fig: 2.4(i) OR Gate 1 1 1 Fig: 2.4(ii) OR Gate Truth Table Fig: 2.4(iii) CMOS OR Gate 12

Timing diagram of OR gate: Fig: 2.4(iv) Timing Diagram of OR Gate 13

2.6 XOR Gate: (1) Instruction Format: XOR Operand A Operand B (2) Function: Operand A and Operand B are two 16 bits register inputs. This operator performs the bitwise XOR operation, and put the result in F = X The truth table defines the behavior of each bit operation shown below: Y INPUT OUTPUT X Y X XOR Y 0 0 0 0 1 1 1 0 1 Fig: 2.5(i) XOR Gate 1 1 0 Fig: 2.5(ii) XOR Gate Truth Table Fig: 2.5(iii) CMOS XOR gate 14

Timing Diagram of XOR gate: Fig: 2.5 (iv) Timing Diagram of XOR Gate. 15

2.7 Full adder: A logic circuit that accepts three digit binary numbers and produce two outputs, a sum output (S) and a carry output (C out ). Fig: 2.6(i) Full-adder Circuit Diagram. 16

Full adder truth table: A B C in C out F 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 Fig: 2.6 (ii) Full-adder Truth Table 17

Chapter -3 Design of Arithmetic Circuit 18

t 3.1 Addition: The arithmetic addition is achieved when one set of inputs receives a binary number A the other set of inputs receives a binary number B, and the input carry is maintained at 0 in fig3.1(i) By making C in = 1, it is possible to add 1 to the sum shown in fig 3.1(ii) A B A B Cou Parallel Adder Cin= 0 Cout Parallel Adder Cin= 1 F=A+B Fig3.1(i)Addition F=A+B+1 Fig: 3.1(ii) Addition with Carry 19

3.2 Complement and Subtraction: Consider the effect of complementing all the bits of input B, with C in = 0, the output produces in fig 3.2(ii). Which is the sum of A plus the 1 s complement of B in fig 3.2(i) adding 1 to this sum by making C in = 1, we obtain F= A+ B +1 A B A B F= A+B+1 F=A+B Fig: 3.2(i) Substraction of B Fig: 3.2(ii)Addition plus 1 s complement 20

3.3 Transfer A and Increment A: Force all 0 s into the B terminals, we obtain F = A + 0 in fig 3.3(i), which transfer input A output F. Adding 1 through C in as in fig3.3(ii) below, we t obtain F = A+1, which is the increment operation. A 0 A 0 Cou Parallel Adder Cin= 0 Cout Parallel Adder Cin= 1 F=A Fig: Fig:3.3(i)Transfer 3.3 (i) Transfer A F=A + 1 Fig: 3.3(ii) Increment A 21

3.4 Decrement A: The condition illustrated in figure that shown bellows. Inserts all 1 s into the B terminals. The produces the decrements operation F = A 1 in fig3.4. To show that this condition is indeed a decrement operation, consider a parallel adder with n full-adder circuits. When the output carry is 1, F=A-1 Fig: 3.4-Decrement A 22

3.5 Basic Operation of 2-bit ALU: There are two types of ALU operation. 1. Simple operation. 2. Complex operation. Simple operations: Most ALU can perform the following operations: Bitwise logic operations (AND, NOT, OR, XOR) Integer arithmetic operations (addition, subtraction, and sometimes multiplication and division, though this is more expensive) Bit-shifting operations (shifting or rotating a word by a specified number of bits to the left or right, with or without sign extension). Shifts can be seen as multiplications and divisions by a power of two. Complex operations: Engineers can design an Arithmetic Logic Unit to calculate any operation. The more complex the operation, the more expensive the ALU is, the more space it uses in the processor, the more power it dissipates. Therefore, engineers compromise. They make the ALU powerful enough to make the processor fast. 23

CHAPTER 4 Design of Logic Circuit 24

4.1 Design of Logic Circuit: Fig: 4.1 Design of Logical Circuit. 25

4.2 Pspice View of project: PSpice View FFig: 4.2 PSpice view of 2-bit ALU 26

4.3 Block Diagram of 2-bit ALU: Block Diagram of a Fig: 4.3 Block diagram of 2- bit ALU 2-Bit ALU Here S 2 S 1 S 0 is the selection variable, A A 1, A 2, B 1, B 2 is the input and C in 1 is Carry in and C out is Carry out. B 1 S 0 S 1 S 2 ALU A 2 B 2 C in ALUALU F2 2 bit result C out 27

4.4 Combining logic and Arithmetic Circuit: C i C i+1 A i One stage of arithmetic Circuit B i S 1 S 0 S 2 0 MUX 1 Select S 2 S 1 S 0 B i Y i C i F i = X i Y i Fi Operation Operation Required 1 0 0 A i 0 One 0 stage of F i = A i Transfer A OR logic Circuit 1 0 1 A i B i 0 Fi = A i B i XOR XOR 1 1 0 A i B i 0 Fi = A i B i Equivalence AND 1 1 1 A i I 0 Fi = A i NOT NOT Fig-4.4 Combining Logic and Arithmetic circuit 28

4.5 Logic Operations in One stage of arithmetic Circuit: Fig: 4.5 Logic Operations in 1 Stage of Arithmetic Circuit 4.6 IC required producing a 2-bit ALU: We used 4 ICs. They are listed below: 29

Fig: 4.6(i) 7432 IC Fig: 4.6(ii) 7408 IC Fig:4.6(iv)7404IC Fig: 4.6(iii)7486 IC 30

4.7 Internal view of using IC: Fig: 4.7(i) 7486IC Fig: 4.7(ii) 7408IC Fig: 4.7(iii) 7432 IC Fig: 4.7(vi) 7404 IC 31

4.8 Hardware Implementation: Fig: 4.8 Hardware Implementation of 2 -bit ALU. 32

CHAPTER-5 Overview of project work 33

5.1 Introduction: The Project topics Arithmetic Logic Unit (ALU) is concerned with the processor unit of digital computers. It discusses a typical arithmetic login unit (ALU) is presented and procedure is developed for the design of any other ALU configuration. 5.2 Background and Motivation: Arithmetic (8-bit and 16-bit) and are highly data parallel. Goal was to build a high performance single chip processor. Small enough and cheap enough. 5.3 Designing the Arithmatic Logic Unit: In this section, we design an ALU with eight arithmetic operations and four logic operations. There selection variables S 2, S 1 and S 0 select eight different iperations, and the input carry C in is used to select four additional arithmetic operations. With, S 2 =0 selection variables S 1 and S 0 together with C in will select the eight arithmetic operations. With S 2 = 1, variables S 1 and S 0 will select the four logic operations OR, XOR, AND, NOT. The design of an ALU is a combinational-logic problem. Because the unit has a regular pattern, it can be broken into identical stages connected in cascade throuth the carries. We can design one stage of the ALU and then duplicate in for the number of stages required. Ther are six inputs to each stage. A i, B i, C in, S 2, S 1 and S 0. There are two outputs in each stage: output F i and the carry out C i+1. One can formulate a trouth table with 64 entries and simplify the two output functions. 34

5.4 Involved in the design of an ALU: The steps involved in the design of the logic section. 1.Design the arithmetic section independent of the logic section. 2.Determine the logic operations obtained from the arithmetic circuit in step 1, assuming that the input carriers to all satges are 0. 3.Modify the arithmetic circuit to obtain the required logic operations. The third step in the design in not a straightforward procedure and requires a certain amount of ingenuity on the part of the designer. It must be realized that various ALUs are available in IC packages. In a practiocal situation, all that one must do is search for a suitable ALU or processor unit among the IC that are available commercially. Yet, the internal logic of the IC selected must have been designed by a person familiar with logic desing tchniques. When S 2 = 1, the input carry C in each stage must be 0. with S 1 S 0 = 00, each stage as it stands generates the function F i = A i. Total change of the output to an OR operation, we must change the input to each full-adder circuit from A i when S 2 S 1 S 0 =100. The unit is to generate an output of F i = A i, To change the output to an OR operation, we must change the input to each full-adder circuit from A i to A i + B i. This can be accomplished by OR, B i and A i when S 2 S 1 S 0 = 110; 35

The other setlection variables that give an undesirable output occur when S 2 S 1 S 0 = 110. The unit stands to generate an output Fi = A i, but We want to generate the AND preartion F i = A i B i. Let us investigate the possibility of Oring each input Ai with some Boolean function Ki. The Function so obtained is then used for X i when S 2 S 1 S 0 = 110; F i =X i Y i = (A i + B i ) B i = A i B i + K i B i + A i K i B i Careful inspection of the result reveals that if the variable K i = B i, we obtain an output: F i = A i B i + B i B i + A i B i B i = A i B i Two terms are equal to 0 because B i B i = 0. The result obtained is the AND operation as required. The conclusion is that, if A i is OR with B i when S 2 S 1 S 0 = 110, the output will generate the AND operation. 36

5.5 2-bit Arithmetic logic unit (ALU) block Diagram: Fig 5.5: Block diagram of 2-bit Arithmetic Logic Unit designed. 37

The final ALU is show in Fig 5.5. Only the first two stages are drown, but the diagram can be easily extended to more stages. The inputs to each full-adder circuit are specified by the Boolean functions: X i = A i + S 2 S 1 S 0 B i + S 2 S 1 S 0 B i Y i = S 0 B i + S i B i Z i = S 2 C i When S2 = 0, the three functions reduce to : X i = A i Y i = S 0 B i + S 1 B i Z i = C i Output Fi is then equal to Xi Yi and produces the exciluseve-orwhen S 2 S 1 S 0 = 100, each A i is OR with B i to provide the OR operation as discussed above. When S 2 S 1 S 0 = 100, each is OR with B i to provide the AND operation as explained previously. The 12 operations generated in the ALU are summarized.the particular function is selected through S 2, S 1, S 0 and Cin. The arithmetic operations are indentical to the ones listed for the arithmetic circuit. The value of Cin for the marked with don tcare X s. 38

5.6 Function of 2 -Bit ALU: The designed a ALU can perform eight arithmetic operations and four logic operations. Three selection variables S 2, S 1 and S 0 select eight different operations and the input carry C in is used to select four additional arithmetic operations. With S 2 =0, selection variables S 1 and S 0 together with C in will select the eight arithmetic operations. With S 2 =1, variables S 1 and S 0 will select the four logic operations OR, XOR, AND and NOT. There are six inputs to each stage A i,b i,c i,s 2, S 1 and S 0. There are two output in each stage: output F i and the carry out C i+1 Table: Function table for arithmetic circuit: Function Select Y equals Output equals Function S 1 S 0 C in 0 0 0 0 F=A Transfer A 0 0 1 0 F=A+1 Increment A 0 1 0 B F=A+B Add B to A 0 1 1 B F= A+B+1 Add B to A plus 1 1 0 0 B F=A+ B Add 1 s complement of B to A 1 0 1 B F=A+ B + 1 Add 2 s complement of B to A 1 1 0 All 1 s F= A-1 Decrement A 1 1 1 All 1 s F=A Transfer A Fig 5.6: Function table of 2 bit ALU 39

CHAPTER- 6 Result and Discussion 40

6.1 Final view of the 2-bit ALU by using functional table: A 2 B 1 B 2 F1 In this F2 table Function we used selection function as S 2 ff,s 1,S 0,C in,and provide 2-bit 1 x x input as A,B[ A 1,A 2, B 1, B 2 ],output as [F 1,F 2 ] and dictinct funtion like 0 1 Transfer A 1 x x addition, subtraction,increment, decrement, transfer,and, OR, XOR. 1 After doing 1 Increment the simulation A we got that function table fig 6.1 has shown 1 1 0 1below 1as a chart Addition : 1 1 0 0 0 Add with carry 1 1 0 0 0 Subtract with borrow 1 1 0 1 0 Subtraction 1 x x 1 0 Decrement A 1 x x 0 1 Transfer A 1 1 0 1 1 OR 1 1 0 0 0 XOR 1 1 0 0 0 AND 1 1 0 1 0 Complement A Function selection Input Output Distinct Function Fig 6.1:- Final view of the 2-bit ALU by using functional table 41

6.2 ADVANTAGES & DISADVANTAGES: ADVANTAGES: 2 bit ALU has minimum delay time to implementation. Minimize the logic gate. Less expensive due to using minimum gate. DISADVANTAGES: Complex circuit diagram. To implement 2 bit ALU we need 4 bit input, but according to 4 bit being just logic, ALU require all the inputs to be present at once. They have no memory. We will look at adding some next time. 2 bit ALU works by 4 bit ALU. Output only 0 to 15. Input we can implement 4, 8 bit ALU. 42

Chapter -7 Conclusion and Future work 43

7.1 Conclusion: In this project we designed and implement 2-bit ALU. We have used Pspice software [version].for simulation we implemented this project on bread board and found satisfactory result on different type of simulation like AND, OR, XOR, transfer, increment, subtraction, decrement etc. 7.2 Future plan: 1. We implemented 2-bit ALU, but we want to work on 8-bit ALU, later on we will try to work on 32-bit or 64-bit as much we can. 2. Our purpose is to reduce the delay time. 3. To make the circuit complex free and less expensive. 4. To implement the circuit by applying latest version of the renown software. 5. Minimizing the logic gate as much it s possible. 44