1 / 50

Digi t al C ircuit Design

Digi t al C ircuit Design. Digit a l Syst e ms and Bin a ry Numb e rs. Depa r t m ent of Com p uter Science Nat i onal C h ia o Tun g. l d v an@ c s . nc t u. edu . tw h t t p: //ww w . cs. n c t u . e du .t w /~l d v a n/. Digi t al C ircuit Design. Outl i ne. L ec t ure 1.

cboyer
Download Presentation

Digi t al C ircuit 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. DigitalCircuit Design DigitalSystemsand BinaryNumbers DepartmentofComputerScienceNationalChiaoTung ldvan@cs.nctu.edu.twhttp://www.cs.nctu.edu.tw/~ldvan/

  2. DigitalCircuit Design Outline Lecture 1 Digital Systems Binary Numbers Number-BaseConversion OctalandHexadecimalNumber SignedBinaryNumbers Binary Codes Binary Storage andRegisters Binary Logic Lan-DaVan

  3. DigitalCircuit Design Digital System Lecture 1 • Digital ageandinformationage Digital computers • generalpurposes • manyscientific,industrialandcommercialapplications • Digital systems • telephoneswitchingexchanges • digitalcamera • electroniccalculators,PDA's • digitalTV • Discrete information-processingsystems • manipulatediscreteelementsofinformation Lan-DaVan

  4. DigitalCircuit Design A DigitalComputerExample Lecture 1 Memory Control unit Datapath CPU Inputs: Keyboard, Outputs: CRT, mouse,modem, microphone LCD, modem, speakers Input/Output Synchronous or Asynchronous? Lan-DaVan

  5. DigitalCircuit Design Signal Lecture 1 • Aninformationvariablerepresentedby physicalquantity Fordigitalsystems,thevariabletakes on digitalvalues • Twolevel,orbinaryvaluesarethemostprevalentvalues • Binary valuesare representedabstractly by: • digits0 and1 • words(symbols)False(F)andTrue(T) • words(symbols)Low(L)andHigh (H) • wordsOnandOff. • Binary valuesare representedby valuesor rangesof values of physicalquantities Lan-DaVan

  6. DigitalCircuit Design Signal Lecture 1 • Analogsignal • t->y: y=f(t),y:C,n:C • Discrete-timesignal • n->y:y=f(nT),y:C,n:Z • Digitalsignal • n->y:y=D{f(nT)},y:Z,n:Z (1110)2 (1000)2 y y y (1011)2 ( 3) ( 2) (1)(1) (1000)2 t n Discrete-Time Signal n AnalogSignal DigitalSignal Lan-DaVan

  7. DigitalCircuit Design BinaryNumbers Lecture 1 Baseor radix Decimal number …a5a4a3a2a1a0.a1a2a3… aj Decimal point Example: 7,329 7103310221019100 Generalform of base-r system a rnarn1 n n1 1 2 m 2 1 • a2raraa ra2r • amr 1 0 1 Coefficient:aj =0 to r  1 Lan-DaVan

  8. DigitalCircuit Design BinaryNumbers Lecture 1 Example:Base-2 number (11010.11)2(26.75)10 124123022121020121122 Example:Base-5 number (4021.2)5 453052251150251(511.4) 5 10 Example:Base-8 number (127.4)8 182281780481(87.5) 10 Example:Base-16number (B65F)111636162516115160(46,687) 1610 Lan-DaVan

  9. DigitalCircuit Design BinaryNumbers Lecture 1 Example:Base-2number (110101)2321641(53)10 SpecialPowersof2 (1024)isKilo, denoted"K" 210 220(1,048,576)is Mega,denoted"M" 230(1,073,741,824)is Giga, denoted"G" Lan-DaVan

  10. DigitalCircuit Design BinaryNumbers Lecture 1 Arithmeticoperations withnumbersinbaserfollowthesamerulesas decimal numbers. Lan-DaVan

  11. DigitalCircuit Design BinaryArithmetic Lecture 1 Subtraction Minuend: 101101 Addition Augend: 101101 ATddheenbd:in+a1r0y01m11ultiplicationtableisSsuimbtpraleh:end: 100111 01=01001|0010=0|01=0Difference:1 000110 Sum0: | 11= MEuxlttiepnlidciantgiomnultiplicationtomultipledigits: Lan-DaVan

  12. DigitalCircuit Design OctalandHexadecimalNumbers Lecture 1 Numberswithdifferentbases:Table1.2. Lan-DaVan

  13. DigitalCircuit Design Number-BaseConversions Lecture 1 Example1.1 Convertdecimal41to binary.Theprocessis continueduntiltheintegerquotient becomes 0. 10/2 5 2 5/2 2/2 1 1/2 0 Lan-DaVan

  14. DigitalCircuit Design Number-BaseConversions Lecture 1 Thearithmeticprocesscanbemanipulatedmoreconvenientlyas follows: Answer=(101001)2 Lan-DaVan

  15. DigitalCircuit Design Number-BaseConversions Lecture 1 Example1.2 Convertdecimal153tooctal.Therequiredbaser is 8. Lan-DaVan

  16. DigitalCircuit Design Number-BaseConversions Lecture 1 Example1.3 Convert(0.6875)10to binary. Theprocessis continueduntilthefraction becomes0 or untilthenumberof digitshas sufficient accuracy. Toconvertadecimalfractiontoa numberexpressedin baser,asimilar procedureisused.However,multiplicationis by rinsteadof2,andthe coefficientsfoundfromtheintegersmayrangein value from0tor1 insteadof0and1. Lan-DaVan

  17. DigitalCircuit Design Number-BaseConversions Lecture 1 Example1.4 Convert (0.513)10tooctal. FromExamples1.1 and1.3: From Examples1.2and1.4: (41.6875)10= (101001.1011)2 (153.513)10= (231.406517)8 Lan-DaVan

  18. DigitalCircuit Design Number-BaseConversions Lecture 1 Conversionfrom binaryto octalcanbe doneby positioningthebinarynumberinto groups of three digitseach, starting from thebinarypointand proceedingtotheleft and totheright. (10110001101011.111100000110)2=(26153.7406)8 2 6 1 5 3 7 4 0 6 Conversionfrom binaryto hexadecimalis similar,exceptthat the binarynumberis dividedinto groupsof four digits: Conversionfrom octalor hexadecimaltobinaryis doneby reversingthepreceding procedure. Lan-DaVan

  19. DigitalCircuit Design Complements Lecture 1 Therearetwotypesofcomplementsforeachbase-rsystem:theradixcomplementand diminishedradixcomplement. ther's complementandthesecondas the(r1)'s complement. • DiminishedRadix Complement Example: For binarynumbers,r= 2andr –1 = 1,so the1'scomplementofN is (2n1) –N. Example: Lan-DaVan

  20. DigitalCircuit Design Complements • Lecture 1 • Radix Complement Ther's complementof an n-digitnumberN inbaser is definedas rn–N for N ≠ 0 and as 0 forN =0.Comparingwiththe(r1) 's complement,wenotethat the r's complementis obtainedbyadding1 tothe(r 1) 's complement,since rn–N = [(rn1)–N] +1. Example:Base-10 The10's complementof012398is 987602 The10's complementof246700is 753300 Example:Base-2 The2'scomplementof 1101100is 0010100 The2'scomplementof 0110111is 1001001 Lan-DaVan

  21. DigitalCircuit Design Complements • Lecture 1 • SubtractionwithComplements • Thesubtractionof twon-digitunsignednumbersM–Ninbaser canbedoneas follows: an Lan-DaVan

  22. DigitalCircuit Design Complements Lecture 1 Example1.5 Using10's complement,subtract72532–3250. Example1.6 Using10's complement,subtract3250–72532 Thereis noendcarry. Lan-DaVan DCD-0 Therefore,theansweris –(10's complementof30718)= 69282.

  23. DigitalCircuit Design Complements Lecture 1 Example1.7 GiventhetwobinarynumbersX =1010100andY =1000011,performthesubtraction(a) X–Yand (b) YX byusing2'scomplement. Thereis noend carry. Therefore,theansweris Y–X =(2'scomplement of1101111)=0010001. Lan-DaVan

  24. DigitalCircuit Design Complements Lecture 1 Subtractionof unsignednumberscanalsobedonebymeansofthe(r 1)'s complement. Rememberthat the(r 1) 'scomplementis onelessthanthe r's complement. Example1.8 Repeat Example1.7,butthis timeusing1'scomplement. Lan-Da Thereis noend carry, Therefore,theansweris Y–X =(1'scomplement of1101110)=0010001. Van

  25. DigitalCircuit Design SignedBinaryNumbers Lecture 1 Torepresentnegativeintegers,weneeda notationfor negativevalues. Itis customary to representthesignwitha bit placedintheleftmostpositionofthe number. Theconventionis tomakethesignbit 0 for positiveand1 fornegative. Example: Lan-DaVan

  26. DigitalCircuit Design SignedBinaryNumbers Lecture 1 Table3 listsallpossiblefour-bitsignedbinarynumbersinthethree representations. Lan-DaVan

  27. DigitalCircuit Design SignedBinaryNumbers • Lecture 1 • ArithmeticAddition • Theadditionof two numbers inthe signed-magnitudesystem followsthe rules of ordinary arithmetic.If thesignsarethe same,weaddthe two magnitudesand give thesum the commonsign.If thesignsaredifferent,wesubtract the smaller magnitude fromthelargerandgive thedifference thesign if the largermagnitude. • Theadditionoftwosignedbinarynumberswithnegative numbersrepresentedin signed-2's-complementform is obtainedfromtheadditionof thetwonumbers, includingtheirsign bits. • Acarryoutof thesign-bitpositionis discarded. • Example: Lan-DaVan

  28. DigitalCircuit Design SignedBinaryNumbers • Lecture 1 • ArithmeticSubtraction • In 2’s-complementform: • Takethe2’s complementofthesubtrahend(includingthesignbit)andadd it to • theminuend(includingsignbit). • Acarryoutof sign-bitpositionis discarded. (A)(B)(A)(B) (A)(B)(A)(B) Example: (6)(13) (1111101011110011) (11111010+00001101) 00000111(+7) Lan-DaVan

  29. DigitalCircuit Design BCDCode Lecture 1 Anumberwithkdecimaldigitswill require 4k bitsinBCD.Decimal396 isrepresentedinBCD with12bitsas 0011 10010110,witheach groupof 4bits representingonedecimaldigit. AdecimalnumberinBCD is the sameas its equivalentbinary number onlywhenthenumberis between0 and9.ABCD number greater than 10 looksdifferentfrom itsequivalentbinarynumber,even though bothcontain1'sand0's. Moreover, the binarycombinations 1010through1111arenot usedand have no meaninginBCD. • BCD Code Lan-DaVan

  30. DigitalCircuit Design BCD Code Lecture 1 Example: Considerdecimal185and its correspondingvalueinBCD andbinary: • BCDAddition Lan-DaVan

  31. DigitalCircuit Design BCD Code Lecture 1 Example: Considertheadditionof 184+576=760inBCD: • DecimalArithmetic 1 Lan-DaVan

  32. DigitalCircuit Design Other DecimalCodes Lecture 1 • OtherDecimalCodes Lan-DaVan

  33. DigitalCircuit Design GrayCode Lecture 1 • GrayCode Lan-DaVan

  34. DigitalCircuit Design GrayCode Lecture 1 Does thisspecialGraycodepropertyhave anyvalue? AnExample:OpticalShaftEncoder 111 000 100 000 B0 B1 B 101 001 001 110 2 G2 G1 G0 111 010 011 101 100011 (a)BinaryCode for Positions0through7 110010 (b)GrayCodeforPositions0through7 Lan-DaVan

  35. DigitalCircuit Design ASCIICharacterCode Lecture 1 • ASCIICharacterCode Lan-DaVan DCD-01-35

  36. DigitalCircuit Design ASCIICharacterCode Lecture 1 • ASCIICharacterCode Lan-DaVan

  37. DigitalCircuit Design ASCIICharacterCode • Lecture 1 • American StandardCodeforInformationInterchange(Refer toTable 1.7) • Apopularcodeusedto represent information sentas character-based data. • Ituses7-bits torepresent: • 94Graphic printingcharacters. • 34Non-printingcharacters • Somenon-printingcharacters are usedfortext format(e.g. • BS= Backspace,CR= carriagereturn) • Othernon-printingcharacters areusedforrecordmarking and flow control (e.g. STX andETX startandendtextareas). Lan-DaVan

  38. DigitalCircuit Design ASCIICharacterCode • Lecture 1 • ASCIIhassome interestingproperties: • Digits0to 9 spanHexadecimalvalues3016to 3916. • UppercaseA -Zspan4116to 5A16. • Lowercasea -zspan6116to 7A16 . • Lowerto uppercase translation(andviceversa) occursbyflippingbit 6. • Delete(DEL)isall bitsset,a carryoverfromwhen punchedpapertape wasusedto store messages. • Punchingall holesina roweraseda mistake! Lan-DaVan

  39. DigitalCircuit Design ErrorDetectionCode • Lecture 1 • Error-DetectingCode • Todetect errors indata communicationandprocessing,aneighthbitis sometimes added to theASCII charactertoindicateitsparity. • Aparitybit is anextrabit includedwithamessageto makethetotalnumberof 1's • either even or odd. • Example: • Considerthefollowingtwocharacters andtheir evenandodd parity: Lan-DaVan

  40. DigitalCircuit Design ErrorDetectionCode • Lecture 1 • Error-DetectingCode • Redundancy(e.g.extra information),intheformof extra bits, canbe incorporatedinto binarycodewords to detect and correcterrors. • Asimpleformof redundancyisparity, anextra bit appended ontothecodeword tomake thenumberof 1’s oddor even. • Parity can detect all single-biterrors andsome multiple-bit errors. • Acodewordhasevenparityifthe numberof 1’s inthecode word is even. • Acodewordhasoddparityifthe numberof 1’s inthecode word is odd. Lan-DaVan

  41. DigitalCircuit Design ConversionorCoding? Lecture 1 DoNOTmixupconversion of a decimal number toa binarynumber withcodinga decimal number witha BINARYCODE. 1310= 11012(Thisisconversion) 13 0001|0011(Thisis coding) Lan-DaVan

  42. DigitalCircuit Design BinaryStorageandRegisters • Lecture 1 • Registers • Abinarycellis a devicethatpossessestwostablestates andis capableof storing one of the twostates. • Aregisteris a groupof binarycells.Aregisterwithncellscanstoreany discrete quantityofinformationthat containsnbits. 2npossiblestates • ncells • Abinarycell • twostablestate • storeonebitofinformation • examples:flip-flopcircuits,ferrite cores, capacitor • Aregister • agroupof binarycells • AXinx86CPU • RegisterTransfer • atransfer of theinformationstored inone registerto another • one of the majoroperationsindigitalsystem Lan-DaVan

  43. DigitalCircuit Design Transferof Information Lecture 1 Lan-DaVan

  44. DigitalCircuit Design ExampleofBinary InformationProcessing Lecture 1 Lan-DaVan DCD-01-44

  45. DigitalCircuit Design BinaryLogic Lecture 1 Binarylogicconsists of binaryvariablesanda setoflogicaloperations. Thevariables aredesignatedby letters of thealphabet,suchasA, B, C, x, y,z, etc,witheach variablehavingtwoandonlytwodistinctpossiblevalues:1 and0,Therearethree basic logicaloperations:AND,OR,and NOT. Lan-DaVan DCD-01-45

  46. DigitalCircuit Design BinaryLogic • Lecture 1 • The truthtablesforAND, OR,and NOTaregiveninTable1.8. Lan-DaVan

  47. DigitalCircuit Design BinaryLogic Lecture 1 • Logic gates • Example of binarysignals Lan-DaVan

  48. DigitalCircuit Design BinaryLogic • Lecture 1 • Logic gates • GraphicSymbolsand Input-OutputSignalsforLogicgates: Lan-DaVan DCD-01-48 Input-Outputsignals forgates

  49. DigitalCircuit Design BinaryLogic • Lecture 1 • Logic gates • GraphicSymbolsand Input-OutputSignalsforLogicgates: Lan-DaVan

  50. DigitalCircuit Design Conclusion Lecture 1 • Youhavelearnedthefollowingterms: • Binarynumber • NumberConversion • Complement • Simplearithmetic • Binarycodes • Storageandregister • Binarylogic Lan-DaVan

More Related