1 COMP541 (160) Digital Logic and Computer Design Montek Singh Jan 11, 2007.

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
CPT 310 Logic and Computer Design Instructor: David LublinerPhone Engineering Technology Dept.Cell
CS 61C L02 Number Representation (1)Harvey / Wawrzynek Fall 2003 © UCB 8/27/2003  Brian Harvey ( John Wawrzynek  (Warznek) (
Digital Fundamentals Floyd Chapter 2 Tenth Edition
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
1 COMP541 Combinational Logic - 2 Montek Singh Jan 18, 2007.
Overview Digital Systems and Computer Systems Number Systems [binary, octal and hexadecimal] Arithmetic Operations Base Conversion Decimal Codes [BCD (binary.
How Computers Represent Information Yong Choi School of Business CSU, Bakersfield.
CSC 110 – Intro to Computing Lecture 3: Converting between bases & Arithmetic in other bases.
DIGITAL ELECTRONICS CIRCUIT P.K.NAYAK P.K.NAYAK ASST. PROFESSOR SYNERGY INSTITUTE OF ENGINEERING & TECHNOLOGY.
Digital Computers and Information
ENEL 111 Digital Electronics Richard Nelson G.1.29
CPS-304 DIGITAL LOGIC & DESIGN Instructor : Ms. Saba Iqbal.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Introduction to Digital Logic Design
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
Digital Logic Dr. Walid Abu-Sufah Read Chapter 1: Sections 1-7 Based on notes by A. Lastra and slides provided by the text publisher.
CSC 101 Introduction to Computing Lecture 9 Dr. Iftikhar Azim Niaz 1.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 1 – Digital Systems and Information Logic.
Topics Introduction Hardware and Software How Computers Store Data
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
COMP541 Digital Logic and Computer Design Montek Singh Aug 20, 2014.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
Computer Systems Organization CS 1428 Foundations of Computer Science.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
مدار منطقي مظفر بگ محمدي Course Structure & Grading Homework: 25% Midterm: 30% Final:50% There is 5% extra! ( =105!) Textbook:
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
1 EGRE 254 Digital Logic Design Lecture 1 Dr. Jerry H. Tucker.
Number Systems ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Chapter 1: Digital Computers and Information Illustration at beginning of each Chapter Base 10 Binary Base 2 Octal Base 8 Hex bas
1 CPRE210: Introduction to Digital Design Instructor –Arun K. Somani –Tel: – –Office Hours: MWF 10:00-11:00 Teaching Assistant.
CS 303 Logic & Digital System Design - An Overview
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Computer Science Binary. Binary Code Remember the power supply that is inside your computer and how it sends electricity to all of the components? That.
Data Representation, Number Systems and Base Conversions
Digital Circuits Text Book –M. M. Mano, "Digital Design," 3rd Ed., Prentice Hall Inc., Reference –class notes Grade –quizzes:15% –mid-term:27.5%
MECH1500 Chapter 3.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL State Machines Anselmo Lastra.
1 COMP541 Digital Logic and Computer Design Montek Singh Jan 9, 2012.
ECE/CS 352 Digital System Fundamentals© T. Kaminski & C. Kime 1 ECE/CS 352 Digital Systems Fundamentals Spring 2001 Chapter 1 Tom Kaminski & Charles R.
COMP541 Digital Logic and Computer Design Montek Singh Jan 11, 2016.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
ASSEMBLY LANGUAGE PROGRAMMING. Course Objectives Identify the major component of a PC-based system, describe the steps involving in assembling, linking,
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Introduction to the FPGA and Labs
Chapter 1 Digital Systems and Binary Numbers
Computer Architecture and Number Systems
Invitation to Computer Science, C++ Version, Fourth Edition
Number Systems and Codes
ENEL 111 Digital Electronics
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Microprocessor Systems Design I
CHAPTER 1 : INTRODUCTION
Introduction to Chapter 2
Digital Electronics Jess 2008.
COMP541 Digital Logic and Computer Design
Introduction The term digital is derived from the way computers perform operation, by counting digits. Application of digital technology: television, communication.
University of Gujrat Department of Computer Science
SYEN 3330 Digital Systems Chapter 1 SYEN 3330 Digital Systems.
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
ENEL 111 Digital Electronics
Dr. Clincy Professor of CS
Presentation transcript:

1 COMP541 (160) Digital Logic and Computer Design Montek Singh Jan 11, 2007

2 Today’s Topics  Course description What’s it about What’s it about Mechanics: grading, etc. Mechanics: grading, etc.  Material from Chapter 1 (review) What is digital logic? What is digital logic? Binary signaling Binary signaling Number systems Number systems Codes Codes

3 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level Only one class on transistors and VLSI Only one class on transistors and VLSI  Each person designs a MIPS CPU and peripheral logic (VGA, joystick) and peripheral logic (VGA, joystick) Project like an Atari 2600 game Project like an Atari 2600 game  High-level language Modern design practices Modern design practices

4 How Can We Do This?  Field Programmable Gate Arrays Chips with a lot of circuits Chips with a lot of circuits  Tens of thousands to millions of transistors Programmable Programmable  We write “programs” describing design  Tools translate to gates/wires  Download pattern to chip

5 We Will Use This Board

6 Schematic Diagram

7Verilog/* * A 32-bit counter with only 4 bits of output. The idea is * A 32-bit counter with only 4 bits of output. The idea is * to select which of the counter stages you want to pass on. * to select which of the counter stages you want to pass on. * * Anselmo Lastra, November 2002 * Anselmo Lastra, November 2002 */ */ module cntr_32c(clk,res,out); module cntr_32c(clk,res,out); input clk; input clk; input res; input res; output [3:0] out; output [3:0] out; reg [31:0] count; reg [31:0] count; (posedge res or posedge clk) if(res) if(res) count <= 0; else count <= count + 1; count <= count + 1; assign out[3] = count[28]; assign out[3] = count[28]; assign out[2] = count[27]; assign out[2] = count[27]; assign out[1] = count[26]; assign out[1] = count[26]; assign out[0] = count[25]; assign out[0] = count[25];endmodule

8 Xilinx Software  Use design tools from chip maker  Have full version on lab PCs  Can install on your PC  ModelSim simulator or built-in

9 Class Web Pages  Linked from my home page  All notes posted Will try to put them there before class Will try to put them there before class  Lab documents there also  See Blackboard for grades

10 Textbook and Syllabus  Largely follow Prof. Lastra’s syllabus  Morris Mano and Charles Kime  Logic and Logic and Computer Design Fundamentals, 3rd Edition  Prentice Hall, 2004  Will largely follow text Slightly different order Slightly different order More emphasis on HLL More emphasis on HLL

11 Overview of Textbook  Chapters 1-6: Digital logic Combinational and sequential Combinational and sequential  Chapter 7-8: Register Transfer and State Machines  Chapter 9: Memories  Chapters 10-12: Computer design  Chapter 13: I/O  Chapter 14: Memory Hierarchies

12 Order of Topics  Will change order from that in book To try to get you working on interesting labs sooner To try to get you working on interesting labs sooner  Move sequential design earlier  Then backfill details on combinational design

13 May Also Need  COMP120 book For MIPS reference For MIPS reference How many have one? How many have one? I can copy the few necessary pages I can copy the few necessary pages  Verilog reference Book optional Book optional Web pages – see course home page Web pages – see course home page

14Grading  Labs – 35% Easier at first; later ones will count more Easier at first; later ones will count more  Homework – 20%  Two tests spaced evenly – 12.5% each  Final – 20% (optional for some)

15Labs  Paced slowly at first Familiarization with tools, simple combinational design, design a digital lock or similar Familiarization with tools, simple combinational design, design a digital lock or similar  Peripheral – VGA, opt. keyboard interface or joystick  Build up computer components Registers, ALU, decoder Registers, ALU, decoder  Assemble a simple MIPS  Add more features, enough for simple computer  Final demo – game or similar

16 Lab Sections  No lab this Friday You need a little more info to begin You need a little more info to begin Begin next week Begin next week  Lab is in SN 027, down the hall by the back entrance

17 Late Policy  Homework assignments and lab reports due by class time Labs due on Tuesday after the lab period Labs due on Tuesday after the lab period  One class late, 10 points off  Two classes late, 25 points off  Not accepted later

18 What’s Your Background?  Course experience  Work, etc.  Which COMP120?  What’s your intent in taking class?  Questions?

19 Office Hours  Would like to wait a week to set  Send if you want to meet

20 Now Shift to Technology Should be review for all of you

21 Digital vs. Analog  Analog – infinite resolution Like (old fashioned) radio dial Like (old fashioned) radio dial We’ll do very little with analog We’ll do very little with analog  VGA, maybe sound  Digital – a finite set of values Like money Like money Can’t get smaller than cents Can’t get smaller than cents Typically also has maximum value Typically also has maximum value

22 Binary Signaling  Zero volts FALSE or 0 FALSE or 0  3.3 or 5 volts TRUE or 1 TRUE or 1  Modern chips down to 1V  Why not multilevel signaling?

23 Discrete Data  Some data inherently discrete Names (sets of letters) Names (sets of letters)  Some quantized Music recorded from microphone Music recorded from microphone Note that other examples like music from CD or electronic keyboard already quantized Note that other examples like music from CD or electronic keyboard already quantized Mouse movement is quantized Mouse movement is quantized  Well, some mice

24 Numbers and Arithmetic  I’ve put most of these slides at end Backup in case you’ve forgotten Backup in case you’ve forgotten  Review of binary numbers, Hexadecimal, Arithmetic  Let’s cover Other codes, parity Other codes, parity

25BCD  Binary Coded Decimal  Decimal digits stored in binary Four bits/digit Four bits/digit Like hex, except stops at 9 Like hex, except stops at 9 Example Example 931 is coded as is coded as  Remember: these are just encodings. Meanings are assigned by us.

26 Other Codes Exist  Non positional  Example: Gray Code Only one bit changes at a time Only one bit changes at a time 000,001,011,010,110,111,101, ,001,011,010,110,111,101,100 Why is this useful? Why is this useful? Actually there’s a family of Gray codes Actually there’s a family of Gray codes Ref:

27 Shaft Encoder

28 Character Codes  From numbers to letters  ASCII Stands for American Standard Code for Information Interchange Stands for American Standard Code for Information Interchange Only 7 bits defined Only 7 bits defined  Unicode  You may make up your own code for the MIPS VGA

29 ASCII table

30 Even Parity  Sometimes high-order bit of ASCII coded to enable detection of errors  Even parity – set bit to make number of 1’s even  Examples A ( ) with even parity is C ( ) with even parity is

31 Odd Parity  Similar except make the number of 1’s odd  Examples A ( ) with odd parity is C ( ) with odd parity is

32 Error Detection  Note that parity detects only simple errors One, three, etc. bits One, three, etc. bits  More complex methods exist  Some that enable recovery of original info Cost is more redundant bits Cost is more redundant bits

33 Today’s Topics  Introduction  Digital logic  Number systems  Arithmetic  Codes  Parity  The encoding is key Standards are used to agree on encodings Standards are used to agree on encodings Special purpose codes for particular uses Special purpose codes for particular uses

34Homework  None, but…  I expect you to know number systems well and be able to do conversions and arithmetic Decimal – Binary Decimal – Binary Binary – Decimal Binary – Decimal Decimal – Hex Decimal – Hex Hex – Decimal Hex – Decimal  Can do some of the problems – 1-2, 1-4, 1-7 if you think you need a refresher. Answers on book website.

35Reading  Skim chapter 1 Quick read to make sure you’re comfortable with material Quick read to make sure you’re comfortable with material  Read Chapter 2

36 Next Week  Combinational Logic Basics  Lab preview I’ll demo tools in class, probably Thursday I’ll demo tools in class, probably Thursday  Lab on Friday the 19 th Schematic capture Schematic capture Maybe simple Verilog Maybe simple Verilog Run on FPGA Run on FPGA

37 Lab Walkthrough  Let’s go see the lab  Shared with LEGO 1 st year seminar

38 Backup Slides Should be all review material

39 Binary Numbers  Strings of binary digits (“bits”) One bit can store a number from 0 to 1 One bit can store a number from 0 to 1 n bits can store numbers from 0 to 2 n n bits can store numbers from 0 to 2 n

40 Binary – Powers of 2  Positional representation  Each digit represents a power of 2 So 101 binary is or = = 5

41 Converting Binary to Decimal  Easy, just multiply digit by power of 2  Just like a decimal number is represented  Example follows

42 Binary  Decimal Example = 156 What is in decimal?

43 Decimal to Binary  A little more work than binary to decimal  Some examples 3 = = 11 (that’s ) 3 = = 11 (that’s ) 5 = = 101 (that’s ) 5 = = 101 (that’s )

44 Algorithm – Decimal to Binary  Find largest power-of-two smaller than decimal number  Make the appropriate binary digit a ‘1’  Subtract the power of 2 from decimal  Do the same thing again

45 Decimal  Binary Example  Convert 28 decimal to binary is too large, so use 16 Binary  10000Decimal  28 – 16 = 12 Binary  11000Decimal  12 – 8 = 4 Next is 8 Binary  11100Decimal  4 – 4 = 0 Next is 4

46Hexadecimal  Strings of 0s and 1s too hard to write  Use base-16 or hexadecimal – 4 bits DecBinHex DecBinHex ? ? ? ? ? ?

47Hexadecimal  Letters to represent DecBinHex DecBinHex a b c d e f Power of 2Power of 2 Size of byteSize of byte Why use base 16?

48 Hex to Binary  Convention – write 0x before number  Hex to Binary – just convert digits BinHex a 1011b 1100c 1101d 1110e 1111f 0x2ac x2ac = No magic – remember hex digit = 4 bits

49 Binary to Hex  Just convert groups of 4 bits BinHex a 1011b 1100c 1101d 1110e 1111f b = 0x537b 0101  0111  0011 

50 Hex to Decimal  Just multiply each hex digit by decimal value, and add the results.  x2ac = 684 DecHex a 11b 12c 13d 14e 15f

51 Decimal to Hex Analogous to decimal  binary. 1. Find largest power-of-16 smaller than decimal number 2. Divide by power-of-16. The integer result is hex digit. 3. The remainder is new decimal number. 4. Do the same thing again

52 Decimal to Hex  DecHex a 11b 12c 13d 14e 15f /256 = 2 0x2__ 684%256 = /16 = 10 = a 0x2a_ 172%16 = 12 = c 0x2ac

53Octal  Octal is base 8  Similar to hexadecimal Conversions Conversions  Less convenient for use with 8-bit bytes

54 Arithmetic -- addition  Binary similar to decimal arithmetic No carries Carries 1+1 is 2 (or 10 2 ), which results in a carry

55 Arithmetic -- subtraction No borrows Borrows results in a borrow

56 Arithmetic -- multiplication Successive additions of multiplicand or zero, multiplied by 2 (10 2 ). Note that multiplication by 10 2 just shifts bits left. 1011X 101

57 Hexadecimal Arithmetic  Similar  If you’re doing by hand, easiest to convert each set of digits to decimal and back  Skill is not very useful…