Download presentation
Presentation is loading. Please wait.
1
CS 150 - Fall 2000 - Introduction - 1 Welcome to CS 150: Components and Design Techniques for Digital Systems zCourse staff yRandy Katz (Instructor), Norm Zhou (Head TA) yTeaching Assistants: Ramki Gummadi, Jimmy Su, Lakmi Subramanian, Laura Todd, Jeff Tsai, Po Yan yReaders: Eugene Chu, Kai Pong zCourse web ywww.cs.Berkeley.edu/~randy/Courses/CS150.F00/ zThis week yWhat is logic design? yWhat is digital hardware? yWhat will we be doing in this class? yClass administration, overview of course web, and logistics
2
CS 150 - Fall 2000 - Introduction - 2 Why are we here? zObvious reasons yCourse is “required” (L&S/CS), prerequisite for CS 152 yImplementation basis for all modern computing devices xBuilding large things from small components xProvide another view of what a computer is zMore important reasons yInherent parallelism in hardware; first exposure to parallel computation yOffers interesting counterpoint to software design; useful in generally furthering our understanding of computation
3
CS 150 - Fall 2000 - Introduction - 3 What will we learn in CS 150? zLanguage of logic design yBoolean algebra, logic minimization, state, timing, CAD tools zConcept of state in digital systems yAnalogous to variables and program counters in software systems zHow to specify/simulate/compile our designs yHardware description languages yTools to simulate the workings of our designs yLogic compilers to synthesize the hardware blocks of our designs yMapping onto programmable hardware (code generation) zContrast with software design yBoth map well-posed problems to physical devices yBoth must be flawless…the price we pay for using discrete math
4
CS 150 - Fall 2000 - Introduction - 4 Applications of logic design zConventional computer design yCPUs, busses, peripherals zNetworking and communications yPhones, modems, routers zEmbedded products yCars, toys, appliances, entertainment devices zScientific equipment yTesting, sensing, reporting zWorld of computing much bigger than just PCs!
5
CS 150 - Fall 2000 - Introduction - 5 A quick history lesson z1850: George Boole invents Boolean algebra yMaps logical propositions to symbols yPermits manipulation of logic statements using mathematics z1938: Claude Shannon links Boolean algebra to switches yHis Masters’ thesis z1945: John von Neumann develops first stored program computer yIts switching elements are vacuum tubes (a big advance from relays) z1946: ENIAC--world’s first all electronic computer y18,000 vacuum tubes ySeveral hundred multiplications per minute z1947: Shockley, Brittain, and Bardeen invent the transistor yreplaces vacuum tubes yenable integration of multiple devices into one package ygateway to modern electronics
6
CS 150 - Fall 2000 - Introduction - 6 What is logic design? zWhat is design? yGiven a specification of a problem, come up with a way of solving it choosing appropriately from a collection of available components yWhile meeting some criteria for size, cost, power, beauty, elegance, etc. zWhat is logic design? yDetermining the collection of digital logic components to perform a specified control and/or data manipulation and/or communication function and the interconnections between them yWhich logic components to choose? – there are many implementation technologies (e.g., off-the-shelf fixed-function components, programmable devices, transistors on a chip, etc.) yThe design may need to be optimized and/or transformed to meet design constraints
7
CS 150 - Fall 2000 - Introduction - 7 Source: Microsoft Encarta sense drive AND What is digital hardware? zCollection of devices that sense and/or control wires carrying a digital value (i.e., a physical quantity interpreted as a “0” or “1”) ye.g., digital logic where voltage 2.0v is a “1” ye.g., pair of transmission wires where a “0” or “1” is distinguished by which wire has a higher voltage (differential) ye.g., orientation of magnetization signifies a “0” or a “1” zPrimitive digital hardware devices yLogic computation devices (sense and drive) xtwo wires both “1” - make another be “1” (AND) xat least one of two wires “1” - make another be “1” (OR) xa wire “1” - then make another be “0” (NOT) yMemory devices (store) xstore a value xrecall a value previously stored
8
CS 150 - Fall 2000 - Introduction - 8 What is happening now in digital design? zBig change in how industry does hardware design yLarger and larger designs yShorter and shorter time to market yCheaper and cheaper products zScale yPervasive use of computer-aided design tools over hand methods yMultiple levels of design representation zTime yEmphasis on abstract design representations yProgrammable rather than fixed function components yAutomatic synthesis techniques yImportance of sound design methodologies zCost yHigher levels of integration yUse of simulation to debug designs
9
CS 150 - Fall 2000 - Introduction - 9 New ability: to accomplish the logic design task with the aid of computer-aided design tools and map a problem description into an implementation with programmable logic devices after validation via simulation and understanding of the advantages/disadvantages as compared to a software implementation CS 150: concepts/skills/abilities zUnderstanding the basics of logic design (concepts) zUnderstanding sound design methodologies (concepts) zModern specification methods (concepts) zFamiliarity with a full set of CAD tools (skills) zAppreciation for the differences and similarities (abilities) in hardware and software design
10
CS 150 - Fall 2000 - Introduction - 10 Computation: abstract vs. implementation zComputation as a mental exercise (paper, programs) zvs. implementing computation with physical devices using voltages to represent logical values zBasic units of computation: yrepresentation:"0", "1" on a wire set of wires (e.g., for binary integers) yassignment:x = y ydata operations:x + y – 5 ycontrol: sequential statements: A; B; C conditionals:if x == 1 then y loops:for ( i = 1 ; i == 10, i++) procedures:A; proc(...); B; zStudy how these are implemented in hardware and composed into computational structures
11
CS 150 - Fall 2000 - Introduction - 11 close switch (if A is “1” or asserted) and turn on light bulb (Z) AZ open switch (if A is “0” or unasserted) and turn off light bulb (Z) Switches: basic element of physical implementations zImplementing a simple circuit (arrow shows action if wire changes to “1”): Z A A Z
12
CS 150 - Fall 2000 - Introduction - 12 AND OR Z A and B Z A or B A B A B Switches (cont’d) zCompose switches into more complex ones (Boolean functions):
13
CS 150 - Fall 2000 - Introduction - 13 Switching networks zSwitch settings yDetermine whether or not a conducting path exists to light the light bulb zTo build larger computations yUse a light bulb (output of the network) to set other switches (inputs to another network). zConnect together switching networks yConstruct larger switching networks, i.e., there is a way to connect outputs of one network to the inputs of the next.
14
CS 150 - Fall 2000 - Introduction - 14 conducting path composed of switches closes circuit current flowing through coil magnetizes core and causes normally closed (nc) contact to be pulled open when no current flows, the spring of the contact returns it to its normal position Relay networks zA simple way to convert between conducting paths and switch settings is to use (electro-mechanical) relays. zWhat is a relay? zWhat determines the switching speed of a relay network?
15
CS 150 - Fall 2000 - Introduction - 15 Transistor networks zRelays aren't used much anymore ySome traffic light controllers are still electro-mechanical zModern digital systems are designed in CMOS technology yMOS stands for Metal-Oxide on Semiconductor yC is for complementary because there are both normally-open and normally-closed switches zMOS transistors act as voltage-controlled switches ySimilar, though easier to work with than relays.
16
CS 150 - Fall 2000 - Introduction - 16 n-channel open when voltage at G is low closes when: voltage(G) > voltage (S) + p-channel closed when voltage at G is low opens when: voltage(G) < voltage (S) – MOS transistors zMOS transistors have three terminals: drain, gate, and source ythey act as switches as follows: if voltage on gate terminal is (some amount) higher/lower than source terminal then a conducting path is established between drain and source terminals G SD G SD
17
CS 150 - Fall 2000 - Introduction - 17 3v X Y 0 volts xy 3 volts 0v what is the relationship between x and y? MOS networks
18
CS 150 - Fall 2000 - Introduction - 18 xy z 0 volts 3 volts 0 volts 3 volts 0 volts 3 volts what is the relationship between x, y and z? Two input networks 3v XY 0v Z 3v XY 0v Z
19
CS 150 - Fall 2000 - Introduction - 19 Speed of MOS networks zWhat influences the speed of CMOS networks? ycharging and discharging of voltages on wires and gates of transistors
20
CS 150 - Fall 2000 - Introduction - 20 scope of CS 150 Representation of digital designs zPhysical devices (transistors, relays) zSwitches zTruth tables zBoolean algebra zGates zWaveforms zFinite state behavior zRegister-transfer behavior zConcurrent abstract specifications
21
CS 150 - Fall 2000 - Introduction - 21 Digital vs. analog zIt is convenient to think of digital systems as having only discrete, digital, input/output values zIn reality, real electronic components exhibit continuous, analog, behavior zWhy do we make this abstraction? y zWhy does it work?
22
CS 150 - Fall 2000 - Introduction - 22 Technology State 0 State 1 Relay logicCircuit OpenCircuit Closed CMOS logic0.0-1.0 volts2.0-3.0 volts Transistor transistor logic (TTL)0.0-0.8 volts2.0-5.0 volts Fiber OpticsLight offLight on Dynamic RAMDischarged capacitorCharged capacitor Nonvolatile memory (erasable)Trapped electronsNo trapped electrons Programmable ROMFuse blownFuse intact Bubble memoryNo magnetic bubbleBubble present Magnetic diskNo flux reversalFlux reversal Compact discNo pitPit Mapping from physical world to binary world
23
CS 150 - Fall 2000 - Introduction - 23 inputsoutputs system Combinational vs. sequential digital circuits zA simple model of a digital system is a unit with inputs and outputs: zCombinational means "memory-less" ya digital circuit is combinational if its output values only depend on its input values
24
CS 150 - Fall 2000 - Introduction - 24 easy to implement with CMOS transistors (the switches we have available and use most) Combinational logic symbols zCommon combinational logic systems have standard symbols called logic gates yBuffer, NOT yAND, NAND yOR, NOR Z A B Z Z A A B
25
CS 150 - Fall 2000 - Introduction - 25 Sequential logic zSequential systems yExhibit behaviors (output values) that depend not only on the current input values, but also on previous input values zIn reality, all real circuits are sequential yThe outputs do not change instantaneously after an input change yWhy not, and why is it then sequential? zA fundamental abstraction of digital design is to reason (mostly) about steady-state behaviors yLook at outputs only after sufficient time has elapsed for the system to make its required changes and settle down
26
CS 150 - Fall 2000 - Introduction - 26 Synchronous sequential digital systems zOutputs of a combinational circuit depend only on current inputs yAfter sufficient time has elapsed zSequential circuits have memory yEven after waiting for the transient activity to finish zThe steady-state abstraction is so useful that most designers use a form of it when constructing sequential circuits: yMemory of a system is represented as its state yChanges in system state are only allowed to occur at specific times controlled by an external periodic clock yClock period is the time that elapses between state changes it must be sufficiently long so that the system reaches a steady-state before the next state change at the end of the period
27
CS 150 - Fall 2000 - Introduction - 27 B A C Clock Example of combinational and sequential logic zCombinational: yinput A, B ywait for clock edge yobserve C ywait for another clock edge yobserve C again: will stay the same zSequential: yinput A, B ywait for clock edge yobserve C ywait for another clock edge yobserve C again: may be different
28
CS 150 - Fall 2000 - Introduction - 28 Abstractions zSome we've seen already ydigital interpretation of analog values ytransistors as switches yswitches as logic gates yuse of a clock to realize a synchronous sequential circuit zSome others we will see ytruth tables and Boolean algebra to represent combinational logic yencoding of signals with more than two logical values into binary form ystate diagrams to represent sequential logic yhardware description languages to represent digital logic ywaveforms to represent temporal behavior
29
CS 150 - Fall 2000 - Introduction - 29 An example zCalendar subsystem: number of days in a month (to control watch display) yused in controlling the display of a wrist-watch LCD screen yinputs: month, leap year flag youtputs: number of days
30
CS 150 - Fall 2000 - Introduction - 30 Implementation in software integer number_of_days ( month, leap_year_flag) { switch (month) { case 1: return (31); case 2: if (leap_year_flag == 1) then return (29) else return (28); case 3: return (31);... case 12: return (31); default: return (0); }
31
CS 150 - Fall 2000 - Introduction - 31 leap month d28d29d30d31 monthleapd28d29d30d31 0000––––– 0001–0001 001001000 001010100 0011–0001 0100–0010 0101–0001 0110–0010 0111–0001 1000–0001 1001–0010 1010–0001 1011–0010 1100–0001 1101––––– 111–––––– Implementation as a combinational digital system zEncoding: yhow many bits for each input/output? ybinary number for month yfour wires for 28, 29, 30, and 31 zBehavior: ycombinational ytruth table specification
32
CS 150 - Fall 2000 - Introduction - 32 symbol for and symbol for or symbol for not Combinational example (cont’d) zTruth-table to logic to switches to gates yd28 = 1 when month=0010 and leap=0 yd28 = m8'm4'm2m1'leap' yd31 = 1 when month=0001 or month=0011 or... month=1100 yd31 = (m8'm4'm2'm1) + (m8'm4'm2m1) +... (m8m4m2'm1') yd31 = can we simplify more? monthleapd28d29d30d31 0001–0001 001001000 001010100 0011–0001 0100–0010... 1100–0001 1101––––– 111–––––– 0000–––––
33
CS 150 - Fall 2000 - Introduction - 33 Combinational example (cont’d) zd28 = m8'm4'm2m1'leap’ zd29 = m8'm4'm2m1'leap zd30 = (m8'm4m2'm1') + (m8'm4m2m1') + (m8m4'm2'm1) + (m8m4'm2m1) zd31 = (m8'm4'm2'm1) + (m8'm4'm2m1) + (m8'm4m2'm1) + (m8'm4m2m1) + (m8m4'm2'm4') + (m8m4'm2m1') + (m8m4m2'm1')
34
CS 150 - Fall 2000 - Introduction - 34 Combinational example (cont’d) zd28 = m8'm4'm2m1'leap’ zd29 = m8'm4'm2m1'leap zd30 = (m8'm4m2'm1') + (m8'm4m2m1') + (m8m4'm2'm1) + (m8m4'm2m1) zd31 = (m8'm4'm2'm1) + (m8'm4'm2m1) + (m8'm4m2'm1) + (m8'm4m2m1) + (m8m4'm2'm4') + (m8m4'm2m1') + (m8m4m2'm1')
35
CS 150 - Fall 2000 - Introduction - 35 Another example zDoor combination lock: ypunch in 3 values in sequence and the door opens; if there is an error the lock must be reset; once the door opens the lock must be reset yinputs: sequence of input values, reset youtputs: door open/close ymemory: must remember combination or always have it available as an input
36
CS 150 - Fall 2000 - Introduction - 36 Implementation in software integer combination_lock ( ) { integer v1, v2, v3; integer error = 0; static integer c[3] = 3, 4, 2; while (!new_value( )); v1 = read_value( ); if (v1 != c[1]) then error = 1; while (!new_value( )); v2 = read_value( ); if (v2 != c[2]) then error = 1; while (!new_value( )); v3 = read_value( ); if (v2 != c[3]) then error = 1; if (error == 1) then return(0); else return (1); }
37
CS 150 - Fall 2000 - Introduction - 37 Implementation as a sequential digital system zEncoding: yhow many bits per input value? yhow many values in sequence? yhow do we know a new input value is entered? yhow do we represent the states of the system? zBehavior: yclock wire tells us when it’s ok to look at inputs (i.e., they have settled after change) ysequential: sequence of values must be entered ysequential: remember if an error occurred yfinite-state specification reset value open/closed new clock state
38
CS 150 - Fall 2000 - Introduction - 38 closed C1=value & new C2=value & new C3=value & new C1!=value & new C2!=value & new C3!=value & new closed reset not new S1S2S3OPEN ERR open Sequential example (cont’d): abstract control zFinite-state diagram yStates: 5 states xrepresent point in execution of machine xeach state has outputs yTransitions: 6 from state to state, 5 self transitions, 1 global xchanges of state occur when clock says it’s ok xbased on value of inputs yInputs: reset, new, results of comparisons yOutput: open/closed
39
CS 150 - Fall 2000 - Introduction - 39 reset open/closed new C1C2C3 comparator value equal multiplexer equal controller mux control clock Sequential example (cont’d): data-path vs. control zInternal structure ydata-path xstorage for combination xcomparators ycontrol xfinite-state machine controller xcontrol for data-path xstate changes controlled by clock
40
CS 150 - Fall 2000 - Introduction - 40 closed mux=C1 reset equal & new not equal & new not new S1S2S3OPEN ERR closed mux=C2 equal & new closed mux=C3 equal & new open Sequential example (cont’d): finite-state machine zFinite-state machine yrefine state diagram to include internal structure
41
CS 150 - Fall 2000 - Introduction - 41 resetnewequalstatestatemuxopen/closed 1–––S1C1closed 00–S1S1C1closed 010S1ERR–closed 011S1S2C2closed 00–S2S2C2closed 010S2ERR–closed 011S2S3C3closed 00–S3S3C3closed 010S3ERR–closed 011S3OPEN–open 0 – –OPENOPEN– open 0 – –ERRERR– closed next Sequential example (cont’d): finite-state machine zFinite-state machine ygenerate state table (much like a truth-table) closed mux=C1 reset equal & new not equal & new not new S1S2S3OPEN ERR closed mux=C2 equal & new closed mux=C3 equal & new open
42
CS 150 - Fall 2000 - Introduction - 42 Sequential example (cont’d): encoding zEncode state table ystate can be: S1, S2, S3, OPEN, or ERR xneeds at least 3 bits to encode: 000, 001, 010, 011, 100 xand as many as 5: 00001, 00010, 00100, 01000, 10000 xchoose 4 bits: 0001, 0010, 0100, 1000, 0000 youtput mux can be: C1, C2, or C3 xneeds 2 to 3 bits to encode xchoose 3 bits: 001, 010, 100 youtput open/closed can be: open or closed xneeds 1 or 2 bits to encode xchoose 1 bits: 1, 0
43
CS 150 - Fall 2000 - Introduction - 43 good choice of encoding! mux is identical to last 3 bits of state open/closed is identical to first bit of state Sequential example (cont’d): encoding zEncode state table ystate can be: S1, S2, S3, OPEN, or ERR xchoose 4 bits: 0001, 0010, 0100, 1000, 0000 youtput mux can be: C1, C2, or C3 xchoose 3 bits: 001, 010, 100 youtput open/closed can be: open or closed xchoose 1 bits: 1, 0 resetnewequalstatestatemuxopen/closed 1–––00010010 00–000100010010 01000010000–0 011000100100100 00–001000100100 01000100000–0 011001001001000 00–010001001000 01001000000–0 01101001000– 1 0 – –10001000– 1 0 – –0000 0000 – 0 next
44
CS 150 - Fall 2000 - Introduction - 44 reset open/closed newequal controller mux control clock reset open/closed newequal mux control clock comb. logic state special circuit element, called a register, for remembering inputs when told to by clock Sequential example (cont’d): controller implementation zImplementation of the controller
45
CS 150 - Fall 2000 - Introduction - 45 system data-path control state registers combinational logic multiplexer comparator code registers registerlogic switching networks Design hierarchy
46
CS 150 - Fall 2000 - Introduction - 46 Summary zThat was what the entire course is about yConverting solutions to problems into combinational and sequential networks effectively organizing the design hierarchically yDoing so with a modern set of design tools that lets us handle large designs effectively yTaking advantage of optimization opportunities zNow lets do it again ythis time we'll take the rest of the semester!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.