CO5023 Introduction to Digital Circuits. What do we know so far? How to represent numbers (integers and floating point) in binary How to convert between.

Slides:



Advertisements
Similar presentations
Fixed Point Numbers The binary integer arithmetic you are used to is known by the more general term of Fixed Point arithmetic. Fixed Point means that we.
Advertisements

EET 1131 Unit 7 Arithmetic Operations and Circuits
The Binary Numbering Systems
Logic Circuits Another look at Floating Point Numbers Common Combinational Logic Circuits Timing Sequential Circuits Note: Multiplication & Division in.
Parallel Adder Recap To add two n-bit numbers together, n full-adders should be cascaded. Each full-adder represents a column in the long addition. The.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Connecting with Computer Science, 2e
Chapter 4 Operations on Bits
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
1 ECE369 Chapter 3. 2 ECE369 Multiplication More complicated than addition –Accomplished via shifting and addition More time and more area.
ECE 301 – Digital Electronics
Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Logic Gates Combinational Circuits
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
3-1 Chapter 3 - Arithmetic Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
Simple Data Type Representation and conversion of numbers
Data Representation – Binary Numbers
Computers Organization & Assembly Language
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
Computer Arithmetic Nizamettin AYDIN
Computer Architecture Lecture 3: Logical circuits, computer arithmetics Piotr Bilski.
Binary Numbers.
3-1 Chapter 3 - Arithmetic Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer Architecture.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Basic Arithmetic (adding and subtracting)
+ CS 325: CS Hardware and Software Organization and Architecture Combinational Circuits 1.
CS1Q Computer Systems Lecture 9 Simon Gay. Lecture 9CS1Q Computer Systems - Simon Gay2 Addition We want to be able to do arithmetic on computers and therefore.
Chapter 6-1 ALU, Adder and Subtractor
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
07/19/2005 Arithmetic / Logic Unit – ALU Design Presentation F CSE : Introduction to Computer Architecture Slides by Gojko Babić.
CH09 Computer Arithmetic  CPU combines of ALU and Control Unit, this chapter discusses ALU The Arithmetic and Logic Unit (ALU) Number Systems Integer.
Oct. 18, 2007SYSC 2001* - Fall SYSC2001-Ch9.ppt1 See Stallings Chapter 9 Computer Arithmetic.
Basic Arithmetic (adding and subtracting)
L/O/G/O CPU Arithmetic Chapter 7 CS.216 Computer Architecture and Organization.
CSC 221 Computer Organization and Assembly Language
Operations on Bits Arithmetic Operations Logic Operations
How computers calculate How binary operations yield complex capabilities.
Computer Arithmetic See Stallings Chapter 9 Sep 10, 2009
IT253: Computer Organization
CS1Q Computer Systems Lecture 2 Simon Gay. Lecture 2CS1Q Computer Systems - Simon Gay2 Binary Numbers We’ll look at some details of the representation.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
1. Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 2.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 1.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
DAT10403 CHAPTER 4 COMPUTER ARITHMETIC By Noordiana Kassim
Invitation to Computer Science, C++ Version, Fourth Edition
Addition and Subtraction
Combinational Circuits
ECE 3130 Digital Electronics and Design
Integer Division.
Reference: Moris Mano 4th Edition Chapter 4
Fundamentals & Ethics of Information Systems IS 201
Invitation to Computer Science, Java Version, Third Edition
CISC101 Reminders Your group name in onQ is your grader’s name.
ECEG-3202 Computer Architecture and Organization
12/7/
Combinational Circuits
XOR Function Logic Symbol  Description  Truth Table 
Presentation transcript:

CO5023 Introduction to Digital Circuits

What do we know so far? How to represent numbers (integers and floating point) in binary How to convert between number bases How to represent signed and unsigned integers How to perform the basic mathematical operations on paper, in binary Addition Subtraction (by addition of two’s complement) Multiplication (left shift and add) Division (right shift and subtract) Modulus (remainder) function Representing non-whole (rational) numbers in binary Fixed and floating point representations Recurring binary digits (i.e. in the representation of 0.1) Notation using mantissa and exponent IEEE 754 floating point standard Sign bit, biased exponent and mantissa with no leading ‘1’ Some operations still work with integer hardware, i.e. sorting of positive numbers and comparison with zero Representation of infinite values and NANs

Other forms of data, a quick overview Once we have the ability to represent numbers, we can use them to represent more complex data. Sound Images Video A sound wave can be represented as a sequence of numbers, which approximate the waveform. Each number is called a ‘sample’ of the wave. Sound quality is dictated by the frequency (speed) of sampling and the precision of the numbers: 44.1 kHz, 16 bit (CD Audio) kHz, 24 bit (DVD Audio)

Images and Video Images are created by dividing the picture up into very small sections called ‘pixels’ and assigning a colour to each. Three numbers required for amount of red, green and blue in the colour of the pixel. Quality is dictated by the number of pixels in the image and the number of bits used per pixel. Once represented in this form images may be compressed using standards such as JPEG Video Basically just a sequence of images ‘Frame rate’ defines number of images per second High frame rate video looks weird!

RGB

Digital Circuits Having established that more or less everything we ever want to do with data can be achieved using numerical data formats and operations, we need to think about how to perform these operations in hardware Addition Subtraction (or adding two’s complements) Multiplication and division (using shifting and addition/subtraction) Logical operations e.g. AND, OR, NOT For this we need to build appropriate circuits with logic gates AND, OR and NOT We also have ‘compound’ gates NAND, NOR, XOR and XNOR As an exercise, write down truth tables for each of these

Addition with logic gates In order to work out how addition might work, let’s think about what actually happens when two bits of a sum are added together: Carry 1 A10011 B 1011 Sum 0 For the rightmost (least significant) bit, there are 2 inputs (from the first and second numbers in the sum, and two outputs (the sum and the carry) We can write the truth table as follows: Can you think of some gates we could use to get the sum and carry values? Can you produce this circuit in logic gate simulator? ABSumCarry

Answer

Addition with logic gates (contd.) When we come to subsequent bits, we have to have three inputs, A, B and C in C in is 1 if there was a carry from the bits on the right and 0 otherwise. The outputs are the same, but we can call the carry C out for clarity Carry 11 A10011 B 1011 Sum 10 Try to complete the truth table opposite yourself… C in ABSumC out

Half adder circuit

Full adder circuit

We combine full adders to make a multibit adder

Chaining adders together We could produce a circuit to add two 8- bit numbers together as shown Sometimes called a “Ripple Carry Adder” (RCA) Verify that the sum in the diagram opposite is correct Red means 1, white means 0 What are the values in decimal? What are the problems with this circuit? Gate delay Solved in practice by using a “Carry Lookahead Adder” (CLA) adings/CLAs.pdf adings/CLAs.pdf Examples of both are on Moodle

Problems Have a go at building two circuits 1.Build a circuit which produces the two’s complement of its input. Input and output should both be 8 bits. 2.Can you build a circuit which will shift the bits of a number to the left or right? Have a think about how you could use these to produce subtractors, multipliers and dividers.

Multiplexers Multiplexers connect several sources to a common output. One of the sources is ‘selected’ by signals on control lines to be connected to the output Can be used, for example, to select which ALU operation should be outputted Selector inputs are on the left. Changing the selectors determines which input is connected to the output. This is how the processor ‘chooses’ which operation is performed Experiment with the ‘4 bit mux.gcg’ file on Moodle to see how it works