Lab Report: Digital Logic

Similar documents
Gates and Circuits 1

Combinational Logic Circuits. Combinational Logic

LOGIC GATES AND LOGIC CIRCUITS A logic gate is an elementary building block of a Digital Circuit. Most logic gates have two inputs and one output.

Unit level 4 Credit value 15. Introduction. Learning Outcomes

Gates and and Circuits

2 Logic Gates THE INVERTER. A logic gate is an electronic circuit which makes logic decisions. It has one output and one or more inputs.

Logic diagram: a graphical representation of a circuit

UNIT-IV Combinational Logic

Number system: the system used to count discrete units is called number. Decimal system: the number system that contains 10 distinguished

Chapter 3 Digital Logic Structures

COMPUTER ORGANIZATION & ARCHITECTURE DIGITAL LOGIC CSCD211- DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF GHANA

Subtractor Logic Schematic

CS302 Digital Logic Design Solved Objective Midterm Papers For Preparation of Midterm Exam

Chapter 1: Digital logic

CS302 - Digital Logic Design Glossary By

UC Berkeley CS61C : Machine Structures

(CSC-3501) Lecture 6 (31 Jan 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

UC Berkeley CS61C : Machine Structures

Approximate Hybrid Equivalent Circuits. Again, the impedance looking into the output terminals is infinite so that. conductance is zero.

Function Table of an Odd-Parity Generator Circuit

Combinational logic. ! Regular logic: multiplexers, decoders, LUTs and FPGAs. ! Switches, basic logic and truth tables, logic functions

Asst. Prof. Thavatchai Tayjasanant, PhD. Power System Research Lab 12 th Floor, Building 4 Tel: (02)

Chapter 3 Digital Logic Structures

This Figure here illustrates the operation for a 2-input OR gate for all four possible input combinations.

DIGITAL ELECTRONICS. Methods & diagrams : 1 Graph plotting : - Tables & analysis : - Questions & discussion : 6 Performance : 3

Module 4: Design and Analysis of Combinational Circuits 1. Module-4. Design and Analysis of Combinational Circuits

Experiment # 4. Binary Addition & Subtraction. Eng. Waleed Y. Mousa

UC Berkeley CS61C : Machine Structures

QUIZ. What do these bits represent?

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 4: Combinational Logic Circuits. Name: Date:

UNIT III. Designing Combinatorial Circuits. Adders

ECE/CoE 0132: FETs and Gates

In this lecture: Lecture 3: Basic Logic Gates & Boolean Expressions

CHAPTER 3 BASIC & COMBINATIONAL LOGIC CIRCUIT

COMPUTER ARCHITECTURE AND ORGANIZATION

Positive and Negative Logic

AREA OPTIMIZED ARITHMETIC AND LOGIC UNIT USING LOW POWER 1-BIT FULL ADDER

Digital Electronics 8. Multiplexer & Demultiplexer

Dr. Nicola Nicolici COE/EE2DI4 Midterm Test #1 Oct 18, 2006

A SUBSTRATE BIASED FULL ADDER CIRCUIT

DESIGN OF 64 BIT LOW POWER ALU FOR DSP APPLICATIONS

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates

Digital. Design. R. Ananda Natarajan B C D

Combinational Circuits DC-IV (Part I) Notes

a b y UC Berkeley CS61C : Machine Structures Hello Helo,world!

Binary Addition. Boolean Algebra & Logic Gates. Recap from Monday. CSC 103 September 12, Binary numbers ( 1.1.1) How Computers Work

Fan in: The number of inputs of a logic gate can handle.

University of Technology

Exercise 2: OR/NOR Logic Functions

Electronics. Digital Electronics

Enhancement of Design Quality for an 8-bit ALU

OBJECTIVE TYPE QUESTIONS FOR PRACTICAL EXAMINATION Subject : Electronics-I ( EC 112)

INTRODUCTION TO DIGITAL CONCEPT

Laboratory Manual CS (P) Digital Systems Lab

Layers. Layers. Layers. Transistor Manufacturing COMP375 1

CHAPTER 5 DESIGN OF COMBINATIONAL LOGIC CIRCUITS IN QCA

ECE380 Digital Logic. Logic values as voltage levels

R.B.V.R.R. WOMEN S COLLEGE (AUTONOMOUS) Narayanaguda, Hyderabad. ELECTRONIC PRINCIPLES AND APPLICATIONS

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) SUMMER-16 EXAMINATION Model Answer

Spec. Instructor: Center

Digital Applications (CETT 1415) Credit: 4 semester credit hours (3 hours lecture, 4 hours lab) Prerequisite: CETT 1403 & CETT 1405

Introduction to Electronics. Dr. Lynn Fuller

Implementation of Full Adder using Cmos Logic

Lecture 0: Introduction

ANALOGUE AND DIGITAL ELECTRONICS STUDENT S WORKBOOK U3: DIGITAL ELECTRONICS

Digital Microelectronic Circuits ( ) CMOS Digital Logic. Lecture 6: Presented by: Adam Teman

Experiment # 3 Combinational Circuits (I) Binary Addition and Subtraction

M.Sc. (Computer Science) Master of Computer Application MS-03 / MCA-203 Course Curriculum for Digital Electronics

Lecture 2: Digital Logic Basis

Computer Architecture and Organization:

;UsetJand : Llto Record the truth. LAB EXERCISE 6.1 Binary Adders. Materials. Procedure

Digital Electronics Course Objectives

EEE 301 Digital Electronics

Topic 6. CMOS Static & Dynamic Logic Gates. Static CMOS Circuit. NMOS Transistors in Series/Parallel Connection

Introduction. BME208 Logic Circuits Yalçın İŞLER

4:Combinational logic circuits. 3 July

Lecture 3: Logic circuit. Combinational circuit and sequential circuit

SRV ENGINEERING COLLEGE SEMBODAI RUKMANI VARATHARAJAN ENGINEERING COLLEGE SEMBODAI

Index terms: Gate Diffusion Input (GDI), Complementary Metal Oxide Semiconductor (CMOS), Digital Signal Processing (DSP).

Subject: Analog and Digital Electronics Code:15CS32

Analysis procedure. To obtain the output Boolean functions from a logic diagram, proceed as follows:

1. The decimal number 62 is represented in hexadecimal (base 16) and binary (base 2) respectively as

Exercise 1: AND/NAND Logic Functions

LIST OF EXPERIMENTS. KCTCET/ /Odd/3rd/ETE/CSE/LM

Layers. Layers. Layers. Transistor Manufacturing COMP375 1

Syllabus for: Electronics for F Y B Sc (Electronics) Semester- 1 (With effect from June 2014) PAPER I: Basic Electrical Circuits

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Computing Layers

Unit 3. Logic Design

International Journal of Scientific & Engineering Research, Volume 5, Issue 5, May-2014 ISSN

COURSE LEARNING OUTCOMES AND OBJECTIVES

Chapter 4 Combinational Logic Circuits

Figure.1. Schematic of 4-bit CLA JCHPS Special Issue 9: June Page 101

Veer Narmad South Gujarat University, Surat

EXPERIMENT 5 Basic Digital Logic Circuits

COMBINATIONAL CIRCUIT

Combinational Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Digital Systems Principles and Applications TWELFTH EDITION. 3-3 OR Operation With OR Gates. 3-4 AND Operations with AND gates

A Low Power and Area Efficient Full Adder Design Using GDI Multiplexer

Design of Low power and Area Efficient 8-bit ALU using GDI Full Adder and Multiplexer

Lecture 02: Logic Families. R.J. Harris & D.G. Bailey

Transcription:

Lab Report: Digital Logic Introduction The aim of the Digital Logic Lab was to construct a simple 4-bit Arithmetic Logic Unit (ALU) in order to demonstrate methods of using Boolean Algebra to manipulate and solve various logic problems. An ALU is used as the basis of a microprocessor and enables the microprocessor to evaluate arithmetic expressions in binary. The ALU was designed using a series of gates. The circuits were then simulated using a computer equipped with Altera's MaxPlus+II. This meant that the circuits could be constructed, tested and modified quickly without purchasing any real components. This report will guide the reader through the Boolean algebra that was learnt and how it was used to design various parts of the ALU. Theory Boolean Algebra Boolean Algebra was developed by George Boole in the 19 th century in order to determine the truth or falsehood of logical prepositions. Boolean algebra has been especially successful in the Electronics and Computing fields because it can be used to model binary systems and the resulting equations can easily be implemented using gates. 1 st Year Electronics Laboratory Autumn Term, 2001 A more complete description of the Boolean Algebra and notation used in this report can be found in the 1 st Year Electronics Laboratory Autumn Term, 2001, but the most important parts will be explained here. de Morgan's Theorem?A? B?= A B?A B?= A? B Using these equations, it can be seen that any logical expression involving AND, NOT and OR can be rewritten using only AND and NOT or only OR and NOT. gates; A? B=?A B? The expression on the right of the equation is known as a NAND gate. A B=?A? B? The expression on the right of the equation is known as a NOR gate. This idea can be developed further by showing that AND operations can be performed using NAND and NOT A B=?A B? and that NOT operations can be performed using a NAND gate;?a A?= A 1 st Year Electronics Laboratory Autumn Term, 2001 In summary, any logical function involving AND, NOT and OR can be rewritten in terms of NAND or NOR gates. Therefore it is only necessary to implement a NAND or NOR gate in hardware to enable any logical function to be built. Most commonly, expressions are implemented using NAND gates instead of NOR gates. Associative Law A B C=?A B? C = A?B C? Andy Bennett : ajb01 : 13/1/2001 : 1/9

Distributive Law Gates A?B? C?=?A B???A C? At the most basic level, gates are simply electronically controlled switches. These switches can then be grouped together to perform functions such as logical AND, NOT and OR thus forming the gate. The switches used in the gates in this report were constructed from Complementary metal-oxide-semiconductor Field Effect Transistors (CMOS FETs). CMOS FETs have three terminals: Source, Drain and Gate and there are two types available: n- channel and p-channel. When a voltage is applied to the Gate of an n-channel CMOS FET, current can flow from the Source to the Drain, therefore, turning the switch on. A p-channel works in the opposite way, so that a current only flows from the Source to the Drain when no voltage is applied to the Gate. 1 st Year Electronics Laboratory Autumn Term, 2001 Figure 1 Circuit symbols for CMOS FETs Practical Implementation of NAND and NOR Gates Figure 2a CMOS NAND Figure 2b CMOS NOR Two's Complement For a normal (unsigned) binary number, the weighting of all the bits is positive;?0011? 2 =0 2 3?0 2 2?1 2 1?1 2 0 =?3? 10 In order to express negative numbers, the most significant bit is given a negative weighting as follows;?1101? 2 =1?-2 3??1 2 2?0 2 1?1 2 0 =?-3? 10 An unsigned binary number can be turned into a two's complement number by inverting all the bits and adding one to the result. Experiments 1 st Year Electronics Laboratory Autumn Term, 2001 The first task in constructing a 4-bit Arithmetic Logic Unit was to provide a facility by which two 4-bit binary numbers - the inputs - could be added together. Then, using the two's complement theory it was not difficult to extend the ALU in order to provide a method of subtracting the two binary inputs from each other. Using these two facilities Andy Bennett : ajb01 : 13/1/2001 : 2/9

it was then possible to make the ALU count by fixing one of the inputs at 1 and adding or subtracting it to or from the other input Finally an instruction was added that allowed the ALU to left shift the bits on input A. This results in multiplication by two of input A. These tasks were accomplished through a series of experiments that are described below; Half Adder Full adder. 4-bit Serial Adder (4-bit ripple through adder). Subtracting Inputs. INC / DEC functions. Left shift Half Adder The truth table for 1-bit binary arithmetic is as follows; A B Sum Carry 0 0 0 0 0 1 0 1 1 0 0 1 1 1 1 0 Table 1 Truth tablefor 1-bit binary arithmetic In order to generate the 1-bit sum of two 1-bit inputs, the following circuit was constructed; Figure 3a Circuit to generate 1-bit Sum From the truth table (Table 1), it can be seen that the carry output is only high when both inputs are high. Therefore, the following equation is true; Carry= A B Carry = A AND B An AND Gate can be constructed from 2 NAND Gates; Full Adder Figure 3b Circuit to generate 1-bit Carry In order to be able to perform arithmetic on numbers that are more than 1-bit long, it is necessary to consider the carry bit from previous stages. The truth table for a full adder is as follows; A B Carry in Carry out Sum 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 Andy Bennett : ajb01 : 13/1/2001 : 3/9

A B Carry in Carry out Sum 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 Table 2 Truth tablefor a 1-bit Full Adder From Table 2, the following equations for Carry out and Sum can be derived; Carry out Carry Out=C OUT Carry in=c IN Sum C OUT =?A B? C IN??A B? C IN?A B? C IN??A B? C IN Using A?B? C?=?A B???A C? ; C OUT =C IN [?A B???A B?]??A B? [C IN?C IN ] C OUT =C IN ( A B )??A B? = XOR -?A B???A B? Equation 1a Carry out for a Full Adder Sum=A?B C IN??A?B C IN??A?B C IN??A?B C IN? Using A?B? C?=?A B???A C? Sum=C IN?A? B??C IN?A B??C IN?A B??C IN?A B? Sum=C IN [?A B???A B?]? C IN [?A B???A B?] Equation 1b Sum for a Full Adder From equations 1a and 1b, it was noticed that the parts highlighted in red are the equation for the Sum of a half adder and the parts highlighted in blue are the equation for the Carry of a half adder. It was then possible to construct the full adder from the following circuit; 4-bit Serial Adder Figure 4 Circuit for a Full Adder N 1-bit full adders can be cascaded to form an N-bit adder by connecting the carry out of one stage to the carry in of the next stage. A 4-bit serial (or ripple-through) adder was constructed; Figure 5 Circuit for a 4-bit Serial Adder Andy Bennett : ajb01 : 13/1/2001 : 4/9

Subtracting the inputs By representing the inputs as two's complement numbers at the input stage to the adder, if a negative number is placed on the input, subtraction takes place; Figure 6 Circuit to subtract input B from input A When the user wants subtract B from A, setting Add_Sub high will deliver the two's complement of B to the adder input. INC / DEC functions By fixing B as one and selecting or deselecting Add_Sub, input A can be incremented or decremented; Left shift Figure 7 Circuit to increment or decrement A (NOTE: datab is fixed to one) Left shifting the bits in input A is equivalent to multiplying it by two. Therefore, by copying input A to input B and adding, the required output will be produced; Figure 8 Circuit to left shift A (NOTE: Binary1 is fixed to one) Andy Bennett : ajb01 : 13/1/2001 : 5/9

Results The ALU was tested as it was built, and the results for each stage can be found in Appendix A The entire ALU was then tested by iterating through every possible combination of inputs; Andy Bennett : ajb01 : 13/1/2001 : 6/9

Discussion and Conclusions Figure 9 Results The results show that the Arithmetic Logic Unit behaved as expected. It was however, noticed that there is a small delay between a change in the inputs and the corresponding change in the outputs. Although the delay is not large, it limits the speed at which the ALU can process data. The delay especially manifests itself in the serial adder beacause each stage can only begin successfully evaluating its inputs when the outputs from the previous stage have stabalised. If the input bus was widened, more stages would be added to the serial adder, resulting in a longer delay. This could be overcome by replacing the serial adder with a parallel adder. In a parallel adder, all the bits are evaluated at the same time. Overall, the investigation was successful in meeting the aim of designing an Arithmetic Logic Unit in order to demonstrate methods of using Boolean Algebra to manipulate and solve various logic problems. The ALU also sucessfully performed useful functions in an efficient manner. Andy Bennett : ajb01 : 13/1/2001 : 7/9

Appendix A - Complete result listing Andy Bennett : ajb01 : 13/1/2001 : 8/9

Appendix B - Note about sources Where information has been based on or paraphrased from a source it is placed between markers as follows; Information from source Source Name Andy Bennett : ajb01 : 13/1/2001 : 9/9