Presentation is loading. Please wait.

Presentation is loading. Please wait.

What Is Digital? (Part 1) Prof. Chung-Ta King Department of Computer Science National Tsing Hua University CS1103 電機資訊工程實習 (Contents from MIT EECS 6.01/6.02,

Similar presentations


Presentation on theme: "What Is Digital? (Part 1) Prof. Chung-Ta King Department of Computer Science National Tsing Hua University CS1103 電機資訊工程實習 (Contents from MIT EECS 6.01/6.02,"— Presentation transcript:

1 What Is Digital? (Part 1) Prof. Chung-Ta King Department of Computer Science National Tsing Hua University CS1103 電機資訊工程實習 (Contents from MIT EECS 6.01/6.02, Wikipedia)

2 1 What Is This?

3 2 Not worry about illegal copy? Music Tapes Were Popular

4 3 Why Not?  Distortion during copying  Tape worn out  causing more distortions and noises May be good for copyright, but certainly not good product Fundamental problem: Information recorded in analog form (and mechanical parts and tape media)

5 4  How to locate a song in an audio tape?  How to tune to a radio station? Problem Processing in Continuous very difficult!

6 It seems... representing, processing, and storing things in discrete/digital form has benefits

7 6 Outline  Continuous versus discrete Problems with “continuous” Going into discrete/digital  Building digital devices IC to digital logic to computing devices  Transforming analog inputs into digital  Transforming digital to analog outputs

8 7 Continuous versus Discrete  Which are “continuous”? Color Light Cars Sound Height and weight Dogs Electric current and voltage English letters Many natural phenomena are continuous

9 8 Problems with Continuous Things  Which one is 桃紅色 ? Imprecise in communication

10 9 Problems with Continuous Things  Difficulties in processing and storage: Detect/remove a stain in photocopy Remove background noises from sound recording Copy from an old tape What if there is a stain?

11 10 But Continuous Carries Huge Info.  Let us use “bits” as an indicator of the amount of information  70 minutes of music  ? bits  A4-sized picture  ? bits  2 hours of movie (DVD)  ? bits  Information carried in continuous things may be of higher density and processed quicker

12 11 Analog Signals  Representing continuous things  Example: Fluctuations in air pressure (i.e. sound) strike the diaphragm of a microphone, which causes corresponding fluctuations in a voltage or the current in an electric circuit The voltage or current is an "analog" of the sound time strength voltage

13 12 Analog Signals  Analog signaling: simulation or duplication of one continuous time varying quantity in another e.g. sound and voltage; hands of a clock and time The former may specify properties or information of some physical phenomena In electronic circuits, the latter is often voltage, frequency, current, or charge  American Heritage Science Dictionary: Measuring or representing data (or things?) by means of one or more physical properties that can express any value along a continuous scale

14 13 Analog Devices  Devices that process analog signals (Analog) television: encodes television and transports the picture and sound information as an analogue signal, e.g. NTSC, PAL Analog computer: a form of computer that uses electrical, mechanical or hydraulic phenomena to model/simulate the problem being solved, e.g. mathematical functions

15 14 Disadvantages of Analog  No system is perfect; can’t reliably engineer perfect components  noise and inaccuracy inevitable As the analog signal is copied and re-copied, processed, or transmitted over long distances, noises or random variations become dominant ‒ May be diminished by using better components, e.g. shielding, good connections Noises make signal loss and distorted, impossible to recover, since amplifying the signal to recover its attenuated parts amplifies the noise as well  Must design system to tolerate some amount of error if it is to process information reliably

16 15 Going into Digital  Easier to communicate if colors are numbered 232037 39 4346

17 16 Going into Digital  Can correct some errors  If the following is received, we know there must be some errors in transmission and can correct to the nearest valid one 1 2

18 Advantages of Going Digital  Increased robustness Allows error correction to be achieved Less sensitivity to imperfections, noises, and environmental interferences  Enables compression of information Efficient use of resources, e.g. storage and transmission  Supports a wide variety of contents Voice, text, video represented as bit stream  Data copied with no reduction in quality  Easy manipulation and editing  Data can be encrypted

19 18 Outline  Continuous versus discrete Problems with “continuous” Going into discrete/digital  Building digital devices IC to digital logic to computing devices  Transforming analog inputs into digital  Transforming digital to analog outputs

20 19 Digital Devices  A digital system uses discrete (discontinuous) values to represent information for input, processing, transmission, storage, etc.  A digital device processes digital information Representations are discrete, but information represented can be discrete or continuous Need a way to represent continuous info. in digital

21 20 Building Digital Electronic Devices  Electric circuits are built from a basis set of primitive components such as voltage sources, resistors, capacitors, inductors and transistors  They carry voltage and current, but voltage and current are continuous things  How to make digital devices out of them  Much easier if binary We have the theory: Boolean algebra We have the component: transistor

22 21 Transistors

23 22 A Working Transistor (1/5)  Transistors consist of three terminals: the source, the gate, and the drain

24 23 A Working Transistor (2/5)  In the n-type transistor, both the source and the drain are negatively-charged and sit on a positively-charged well of p-silicon

25 24 A Working Transistor (3/5)  When positive voltage is applied to the gate, electrons in the p-silicon are attracted to the area under the gate forming an electron channel between the source and the drain

26 25 A Working Transistor (4/5)  When positive voltage is applied to the drain, the electrons are pulled from the source to the drain. In this state the transistor is on 開

27 26 A Working Transistor (5/5)  If the voltage at the gate is removed, electrons are not attracted to the area between the source and drain. The pathway is broken and the transistor is turned off 關

28 27 Transistor as Electronic Switch “gate” as the switch

29 28 Transistor Abstraction Hide the complexity of low-level circuits

30 29 With Switches, Can Build Logic CMOS

31 灌溉渠道的類比 水滿  水乾 水乾  水滿 V dd 電晶體以電壓 來表達資訊 灌溉渠道以水流 來表達資訊 以水流來控制 閘門開關

32 31 CMOS NAND

33 32 Combining Gates  Full adder:

34 33 灌溉渠道的類比 C out X C in 水庫 (V dd ) 運算所用的資料, x, y, 其實是控制邏輯閘 的信號

35 34 4-Bit Parallel Adder

36 35 Integrated Circuit (IC)

37 36 Combinational Circuit  A type of logic circuit whose output is a pure function of the present input, i.e. y=f(x) one or more digital inputs/outputs a functional specification that details the value of each output for every possible combination of valid input values a timing specification on the required time for the device to compute the specified output values from an arbitrary set of stable, valid input values No state No memory

38 37 In Reality, Circuits Have Delays  Propagation delay (t PD ): An UPPER BOUND on the delay from valid inputs to valid outputs 1  0 0  1 當輸入端的水道開始由滿到乾 輸出端的水道何時由乾到注滿

39 38 Key to System Design  A system is a structure that is guaranteed to exhibit a specified behavior, assuming all of its components obey specified behaviors  How is this achieved? Contracts!  Every system component will have clear obligations and responsibilities If these are maintained, we have every right to expect the system to behave as planned

40 39 The Combinational Contract If read output here, guarantee correct/valid value No promises during Timing is important!!!

41 40 Propagation Delay of Circuit  If NAND gates have a t PD = 4ns t PD = _______ ns t PD is the maximum cumulative propagation delay over all paths from inputs to outputs Contract: After changing input signals, you must wait at least t PD until output is steady before you can read the output

42 41 灌溉渠道的類比 1  1 0  1 1  0 0  1 要等多久全部水位 才能到達穩定狀態 ?

43  A logic circuit that can store one bit (D flip-flop) 42 Can Do Memory from Logic clock Often controlled by “clock” 產生蓄水池的效果

44 43 Edge-triggered D Flip-Flop  On the rising edge of CLK, the value of D is saved in the flip-flop and then shortly afterwards appears on Q Multiple D flip-flops make a register D Q CLK

45 44 Sequential Logic  A type of logic circuit whose output depends not only on the present input but also on the history of the input, i.e. recorded in the internal storage, c.f. combinational circuit 蓄水池

46 45 Synchronous Sequential Logic  There is a 'clock' signal, and all internal memory (the 'internal state') changes only on a clock edge Nearly all sequential logic today is synchronous Period greater than every combinational delay clock Propagation delay Implications: Processor clock rate Static/dynamic power

47 46 Synchronous versus Asynchronous  Synchronous logic is simple Every operation in the circuit must be completed inside a fixed interval of time between two clock pulses, called a clock cycle As long as this condition is met (ignoring certain details), the circuit is guaranteed to be reliable Only care about value of combinational circuits just before rising edge of clock Change saved state after noise-inducing logic transitions have stopped!

48 47 Problem with Synch. Circuits  Clock must be distributed to every flip-flop in the circuit Distribution consumes power and dissipates heat Distribution causes delays  Maximum possible clock rate determined by slowest logic path in the circuit, critical path Every logical calculation must complete in one clock cycle Can split complex operations into several simple operations, a technique known as 'pipelining'

49 48 With Memory, Logic  Computer Z N 暫存器 記憶體 PCIR 控制器 ALU clock 控制信號


Download ppt "What Is Digital? (Part 1) Prof. Chung-Ta King Department of Computer Science National Tsing Hua University CS1103 電機資訊工程實習 (Contents from MIT EECS 6.01/6.02,"

Similar presentations


Ads by Google