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:
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)
1 What Is This?
2 Not worry about illegal copy? Music Tapes Were Popular
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)
4 How to locate a song in an audio tape? How to tune to a radio station? Problem Processing in Continuous very difficult!
It seems... representing, processing, and storing things in discrete/digital form has benefits
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
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
8 Problems with Continuous Things Which one is 桃紅色 ? Imprecise in communication
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?
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
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
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
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
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
15 Going into Digital Easier to communicate if colors are numbered
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
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
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
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
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 A Working Transistor (1/5) Transistors consist of three terminals: the source, the gate, and the drain
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
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
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 開
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 關
27 Transistor as Electronic Switch “gate” as the switch
28 Transistor Abstraction Hide the complexity of low-level circuits
33 灌溉渠道的類比 C out X C in 水庫 (V dd ) 運算所用的資料, x, y, 其實是控制邏輯閘 的信號
34 4-Bit Parallel Adder
35 Integrated Circuit (IC)
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
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 當輸入端的水道開始由滿到乾 輸出端的水道何時由乾到注滿
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
39 The Combinational Contract If read output here, guarantee correct/valid value No promises during Timing is important!!!
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
A logic circuit that can store one bit (D flip-flop) 42 Can Do Memory from Logic clock Often controlled by “clock” 產生蓄水池的效果
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
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 蓄水池
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
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!
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'
48 With Memory, Logic Computer Z N 暫存器 記憶體 PCIR 控制器 ALU clock 控制信號