1 / 59

COMP541 (160) Digital Logic and Computer Design

COMP541 (160) Digital Logic and Computer Design Montek Singh Jan 12, 2010 Today’s Topics Course description What’s it about Mechanics: grading, etc. Material from Chapter 1 (self-study review) What is digital logic? Binary signaling Number systems Codes What’s Course About?

omer
Download Presentation

COMP541 (160) Digital Logic and Computer Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMP541 (160) Digital Logic and Computer Design Montek Singh Jan 12, 2010

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

  3. What’s Course About? • Digitallogic, focusing on the design of computers • Stay mostly at a high level (i.e., above transistors) • Each person designs a MIPS CPU • and peripheral logic (VGA, joystick) • Project like an Atari 2600 game • High-level language • Modern design practices

  4. Focus • Stay above transistor level • At most one class on transistors and VLSI • Expect you to know assembly language programming

  5. More Than Just Architecture • Designing and implementing a computer is also about • Managing complexity (hierarchy, modularity, regularity). • Debugging • Testing and verifying

  6. The Three -Y’s • Hierarchy • A system divided into modules and submodules • Modularity • Having well-defined functions and interfaces • Regularity • Encouraging uniformity, so modules can be easily reused

  7. How Can We Do This? • Labs on Fridays • Use: Field Programmable Gate Arrays (FPGAs) • Chips with a lot of circuits • Tens of thousands to millions of transistors • Programmable • We write descriptions of the design • “programs” describing design • Tools translate to gates/wires • Download pattern/interconnection to chip • Sort of like burning music to a rewritable CD

  8. We Will Use This Board What’s on it?

  9. Schematic Diagram • Old fashioned way to describe logic • Still useful for documentation

  10. Verilog /* * 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. * * Anselmo Lastra, November 2002 */ module cntr_32c(clk,res,out); input clk; input res; output [3:0] out; reg [31:0] count; always @ (posedge res or posedge clk) if(res) count <= 0; else count <= count + 1; assign out[3] = count[28]; assign out[2] = count[27]; assign out[1] = count[26]; assign out[0] = count[25]; endmodule

  11. Xilinx Software • Use design tools from chip maker • Have full version on lab PCs • Can install on your PC • Download from web

  12. Class Web Pages • Will be up by Thursday’s class • Linked from my home pagehttp://www.cs.unc.edu/~montek • All lecture slides posted there • Will try to put them there before class • Schedule, homework, etc. posted there • Lab documents there also • See Blackboard for scores/grades

  13. Textbook • Harris and Harris • Digital Design and Computer Architecture • Morgan Kaufmann, 2007 • Amazon has for $70 • Extra material on http://www.elsevierdirect.com/companion.jsp?ISBN=9780123704979

  14. Overview of Textbook • Chapters 1-5: Digital logic • Combinational, sequential, basic circuits, HDL • Chapter 6: Architecture • Fast – review for those who took COMP 411 • Chapter 7: Microarchitectures • Chapters 8: Memories • Appendix A: Implementation • FPGAs, etc.

  15. Order of Topics • Will change order from that in book • To try to get you working on interesting labs sooner

  16. May Also Need • COMP411 textbook (Patterson/Hennessy) • For MIPS reference • How many have one? • I can copy the few necessary pages • Verilog reference • Book optional • Web pages – see course home page

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

  18. Labs • Paced slowly at first • 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 • Assemble a simple MIPS • Add more features, enough for simple computer • Final demo – game or similar

  19. Lab Sections • No lab this Friday • You need a little more info to begin • Begin next week • Lab is in SN 027

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

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

  22. Office Hours • Would like to wait a week to set • Send email if you want to meet in the mean time

  23. Now Shift to Technology Should be review for all of you

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

  25. Binary Signaling • Zero volts • FALSE or 0 • 5 or 3.3 (or 1.8 or 1.5) volts • TRUE or 1 • Modern chips down to 1V • Why not multilevel signaling?

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

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

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

  29. Other Codes Exist • Non positional • Example: Gray Code • Only one bit changes at a time • 000,001,011,010,110,111,101,100 • Why is this useful? • Actually there’s a family of Gray codes Ref: http://lib-www.lanl.gov/numerical/bookcpdf/c20-2.pdf

  30. Shaft Encoder

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

  32. ASCII table

  33. 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 (01000001) with even parity is 01000001 C (01000011) with even parity is 11000011

  34. Odd Parity • Similar except make the number of 1’s odd • Examples A (01000001) with odd parity is 11000001 C (01000011) with odd parity is 01000011

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

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

  37. Homework • None, but… • I expect you to know number systems well and be able to do conversions and arithmetic • Decimal – Binary • Binary – Decimal • Decimal – Hex • Hex – Decimal • Can do some of the problems – 1.7 to 1.27 are all about conversion – if you think you need a refresher. Answers to odd numbered on book website.

  38. Reading • Read Chapter 1

  39. Next Class • Combinational Logic Basics Next Week: Lab preview • I’ll demo tools in class, probably Thursday

  40. Lab Walkthrough • Let’s go see the lab

  41. Backup Slides Should be all review material

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

  43. Binary – Powers of 2 • Positional representation • Each digit represents a power of 2 So 101 binary is 1 • 22 + 0 • 21 + 1 • 20 or 1 • 4 + 0 • 2 + 1 • 1 = 5

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

  45. Binary  Decimal Example What is 10011100 in decimal? 128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = 156

  46. Decimal to Binary • A little more work than binary to decimal • Some examples • 3 = 2 + 1 = 11 (that’s 1•21 + 1•20) • 5 = 4 + 1 = 101 (that’s 1•22 + 0•21 + 1•20)

  47. 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

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

  49. Hexadecimal • Strings of 0s and 1s too hard to write • Use base-16 or hexadecimal – 4 bits

  50. Hexadecimal Why use base 16? • Letters to represent 10-15 • Power of 2 • Size of byte

More Related