[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"i-lucide:moon":3,"i-lucide:sun":8,"i-lucide:menu":10,"sample:bits-and-voltage":12,"i-lucide:arrow-left":496,"i-lucide:lightbulb":498,"i-lucide:plus":500,"i-lucide:arrow-right":502,"i-lucide:chevron-down":504,"i-lucide:message-circle":506,"i-lucide:swords":508},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"4\"\u002F>\u003Cpath d=\"M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 5h16M4 12h16M4 19h16\"\u002F>",{"slug":13,"title":14,"summary":15,"discipline_slug":16,"discipline_name":17,"category_slug":18,"estimated_minutes":19,"interactions":20,"version":23,"examples":342},"bits-and-voltage","How a computer turns electricity into 0s and 1s","Digital circuits represent 0 and 1 with two ranges of voltage separated by a gap. This lesson explains logic levels, thresholds, the forbidden zone and the noise margin, and shows why ignoring the exact voltage makes digital signals robust.","electronics","Electronics","engineering-and-technology",25,[21,22],"function_explorer","quiz",{"id":24,"lesson_id":25,"version":26,"status":27,"title":14,"summary":15,"objective":28,"estimated_minutes":19,"document":29,"content_hash":337,"published_at":338,"change_note":38,"provenance":339},"75298b3e-f9a9-40f1-b1f2-9ff994d84d9c","ec6d4003-ce57-46c1-95ad-c3b9f3b3c1f7",1,"published","Explain how two voltage levels can represent 0 and 1, and why digital circuits tolerate noise.",{"schema_version":26,"title":14,"summary":15,"objective":28,"estimated_minutes":19,"sections":30,"vocabulary":308,"references":336},[31,41,49,65,108,184,244,296],{"kind":32,"title":33,"blocks":34},"goal","What you will be able to do",[35],{"id":36,"depth":37,"emphasis":38,"type":39,"markdown":40},"goal-outcomes","core",null,"rich_text","By the end of this lesson you will be able to:\n\n- explain how a circuit uses two ranges of voltage to stand for the bits 0 and 1,\n- say what a threshold and the forbidden zone are, and why the zone exists,\n- work out a noise margin from the output and input limits of a logic family,\n- explain why a digital signal can pass through many stages without getting worse.",{"kind":42,"title":43,"blocks":44},"why","Why it matters",[45],{"id":46,"depth":47,"emphasis":38,"type":39,"markdown":48},"why-matters","standard","Every digital device, from a doorbell chip to a data centre, rests on one design decision: a wire is allowed to mean only two things. It carries a voltage, as any wire does, but the circuit at the other end does not ask *how many volts?* It asks only *high or low?*\n\nThat decision is why digital information can be copied and passed on without wearing out. Copy an old cassette tape and the copy has a little more hiss than the original; copy the copy and it is worse again. Copy a file a thousand times and the last copy is normally identical to the first, bit for bit. The difference is not better components. A digital circuit throws away small errors at every step, and this lesson shows how.",{"kind":50,"title":51,"blocks":52},"recall","What this builds on",[53,56],{"id":54,"depth":47,"emphasis":38,"type":39,"markdown":55},"recall-prerequisites","Two ideas are enough to start.\n\n- **Voltage.** Voltage is an electrical difference between two points, measured in volts (V), a little like the difference in pressure between two points in a water pipe. In a circuit one point is chosen as the reference and called **ground**, at 0 V. 'The voltage on a wire' means the voltage between that wire and ground. A circuit's **supply voltage**, for example 5 V, is normally the highest voltage found in it.\n- **Bits.** A bit is a value that is either 0 or 1. Everything a computer stores or sends, whether numbers, text, images or sound, is encoded as patterns of bits.",{"id":57,"depth":47,"emphasis":38,"type":22,"kind":58,"prompt":59,"options":60,"numeric":61,"hint":63,"explanation":64},"recall-patterns","numeric","Quick recall: how many different patterns can three bits form?",[],{"value":62,"tolerance":4,"unit":38},8,"Each extra bit doubles the number of patterns.","Each bit has two possible values, so three bits give 2 × 2 × 2 = 8 patterns: 000, 001, 010, 011, 100, 101, 110 and 111. To carry three bits at once a circuit can use three wires, each of which only has to tell two states apart. That is the theme of this lesson: keep the job of each wire as simple as possible.",{"kind":66,"title":67,"blocks":68},"explanation","From volts to bits",[69,72,75,78,84,87,93,98],{"id":70,"depth":37,"emphasis":38,"type":39,"markdown":71},"explain-two-levels","**Two meanings for one wire.** Take a circuit powered by 5 V. The simplest way to make a wire carry a bit is an agreement between the circuit that drives the wire (the *sender*) and the circuit that reads it (the *receiver*):\n\n- a voltage near 0 V means **0**, also called **LOW**,\n- a voltage near 5 V means **1**, also called **HIGH**.\n\nThe word *near* matters. No real circuit produces exactly 0.000 V or 5.000 V. Components vary, wires have resistance, and other signals nearby disturb the voltage. So the agreement cannot be about two exact values. It has to be about two **ranges**.",{"id":73,"depth":37,"emphasis":38,"type":39,"markdown":74},"explain-ranges","**Ranges, a threshold and a forbidden zone.** A receiver decides between 0 and 1 by comparing its input with a **threshold**, a voltage somewhere in the middle. Below the threshold it reads 0; above it, it reads 1.\n\nThe difficulty is that the threshold is not the same for every chip. It shifts a little with manufacturing differences, temperature and supply voltage. So the maker of a chip does not promise an exact threshold. It promises two limits. This lesson uses the following illustrative numbers for a 5 V circuit; real families of chips publish their own, and they differ:\n\n- any input at or **below 1.5 V** will be read as **0**,\n- any input at or **above 3.5 V** will be read as **1**.\n\nThe real threshold lies somewhere between 1.5 V and 3.5 V, but you are not told where. That gap is the **forbidden zone**, also called the undefined region. Nothing is promised about how an input there will be read: one chip may see a 0, another a 1, and a third may waver between them. A well-designed circuit makes sure that its signals never rest there.",{"id":76,"depth":37,"emphasis":38,"type":39,"markdown":77},"explain-margin","**Senders are held to a stricter standard.** If senders only had to stay just outside the forbidden zone, a 1 sent at 3.5 V would be one small disturbance away from trouble. So a sender is required to stay well clear of the zone. Again with illustrative numbers:\n\n- when sending a **0**, the output is at most **0.5 V**,\n- when sending a **1**, the output is at least **4.5 V**.\n\nNow compare the two sets of limits. A 1 leaves the sender at 4.5 V or more, and the receiver accepts anything down to 3.5 V. The difference, 1.0 V, is the **noise margin**: the amount by which the voltage can be disturbed on the way without any risk that the bit is misread. For a 0 the margin is 1.5 V − 0.5 V, which is also 1.0 V.\n\nEngineers give the four limits standard names: $V_{OH}$ and $V_{OL}$ for what an output produces when it sends HIGH and LOW, and $V_{IH}$ and $V_{IL}$ for what an input accepts as HIGH and LOW.",{"id":79,"depth":37,"emphasis":38,"type":80,"latex":81,"spoken":82,"caption":83},"formula-margin","formula","NM_H = V_{OH} - V_{IH}, \\qquad NM_L = V_{IL} - V_{OL}","The high noise margin equals V O H minus V I H: the lowest voltage a sender produces for a 1, minus the lowest voltage a receiver accepts as a 1. The low noise margin equals V I L minus V O L: the highest voltage a receiver accepts as a 0, minus the highest voltage a sender produces for a 0.","Noise margins. With this lesson's numbers: 4.5 V − 3.5 V = 1.0 V and 1.5 V − 0.5 V = 1.0 V.",{"id":85,"depth":37,"emphasis":38,"type":39,"markdown":86},"explain-worked","**Worked example.** A sender puts a 1 on a wire at 4.5 V, the lowest level it is allowed to use. On the way, interference from a neighbouring wire pulls the voltage down by 0.7 V.\n\n1. The receiver sees 4.5 − 0.7 = 3.8 V.\n2. Is that inside a guaranteed range? Yes: 3.8 V is above 3.5 V, so every receiver that meets its specification reads a 1.\n3. What does the receiver pass on? Its own output is driven afresh to a full level, 4.5 V or more for a 1. The 0.7 V disturbance is not handed on to the next stage. It has been discarded.\n\nNow suppose the interference were 1.3 V. The receiver would see 3.2 V, which is inside the forbidden zone. The bit *might* still be read correctly, but nothing guarantees it. The disturbance has exceeded the 1.0 V noise margin.",{"id":88,"depth":37,"emphasis":38,"type":89,"tone":90,"title":91,"markdown":92},"explain-key","callout","key_idea","Why digital circuits tolerate noise","A digital receiver does not care about the exact voltage, only about which range it falls in. Any disturbance smaller than the noise margin therefore changes nothing. And because each stage sends on a fresh, full-strength level, small disturbances are removed at every step instead of adding up along the way.",{"id":94,"depth":47,"emphasis":38,"type":89,"tone":95,"title":96,"markdown":97},"explain-switching","note","What about the moment a signal changes?","To change from 0 to 1 a voltage has to cross the forbidden zone: there is no other way to get from 0.5 V to 4.5 V. This is expected. Circuits are designed so that signals cross quickly and spend nearly all of their time at a valid level, and most digital systems use a clock so that an input is read only after it has had time to settle.",{"id":99,"depth":100,"emphasis":101,"type":102,"title":103,"blocks":104},"explain-real","extended","practical","expandable","How do real logic families compare?",[105],{"id":106,"depth":100,"emphasis":38,"type":39,"markdown":107},"real-families","The numbers in this lesson are round figures in the style of 5 V CMOS logic, chosen to make the arithmetic easy. Real families publish their own limits in their data sheets, and those limits depend on the supply voltage, the temperature and the current that the output has to deliver.\n\nA well-known example is classic 5 V TTL logic, whose limits are: output LOW at most 0.4 V, output HIGH at least 2.4 V, input LOW at most 0.8 V, input HIGH at least 2.0 V. Its noise margins are therefore 0.4 V at each level, and its ranges are not placed symmetrically between 0 V and 5 V.\n\nModern chips usually run from lower supply voltages, such as 3.3 V, 1.8 V or less, because lower voltages use less power and suit the smaller transistors of modern chips. The price is that the ranges, and with them the noise margins, shrink in absolute terms. The principle stays the same: two guaranteed ranges, a gap between them, and stricter limits for outputs than for inputs.",{"kind":109,"title":110,"blocks":111},"illustration","Following one bit down a wire",[112,156,160,181],{"id":113,"depth":47,"emphasis":38,"type":114,"title":115,"description":116,"kind":117,"direction":118,"nodes":119,"edges":144},"illustrate-path","diagram","One bit travelling from sender to receiver","A sender drives a wire to a clean voltage level. Noise sources add an unwanted voltage to the wire. The receiver compares what arrives with its threshold, decides whether the bit is 0 or 1, and sends a fresh, clean level on to the next stage.","flow","down",[120,124,128,132,136,140],{"id":121,"label":122,"detail":123,"group":38},"sender","Sender","Drives the wire to a clean level: at most 0.5 V for a 0, at least 4.5 V for a 1 (illustrative values).",{"id":125,"label":126,"detail":127,"group":38},"wire","Wire","Carries the voltage to the receiver. What arrives is the level that was sent plus whatever the wire has picked up.",{"id":129,"label":130,"detail":131,"group":38},"noise","Noise sources","Neighbouring signals switching, dips in the supply voltage, radio interference, and voltage lost in the wire's own resistance.",{"id":133,"label":134,"detail":135,"group":38},"receiver","Receiver","Compares the arriving voltage with its threshold. At or below 1.5 V it reads 0; at or above 3.5 V it reads 1.",{"id":137,"label":138,"detail":139,"group":38},"decision","Decided bit: 0 or 1","The exact voltage is discarded. Only the decision is kept.",{"id":141,"label":142,"detail":143,"group":38},"next-stage","Next stage","Receives a fresh, clean level from the receiver's own output, so the earlier noise is not passed on.",[145,148,150,152,154],{"source":121,"target":125,"label":146,"directed":147},"clean level",true,{"source":129,"target":125,"label":149,"directed":147},"unwanted voltage",{"source":125,"target":133,"label":151,"directed":147},"level plus noise",{"source":133,"target":137,"label":153,"directed":147},"compare with threshold",{"source":137,"target":141,"label":155,"directed":147},"fresh, clean level",{"id":157,"depth":47,"emphasis":158,"type":39,"markdown":159},"illustrate-restoring-intro","theoretical","**Seeing restoration on a graph.** The plot below shows an idealised *buffer*: a digital stage whose output bit is the same as its input bit. The horizontal axis is the voltage arriving at its input, and the vertical axis is the voltage it sends on. The straight line is there for comparison. It shows a plain wire, which passes on exactly the voltage it receives, noise included. (The S-shaped curve is a smooth illustration of the idea, not the measured curve of any particular chip.)",{"id":161,"depth":47,"emphasis":158,"type":21,"title":162,"variable":163,"domain":164,"y_range":166,"x_label":38,"y_label":38,"parameters":169,"functions":170,"prompts":177},"illustrate-restoring","A restoring stage: output voltage against input voltage (x is the input in volts)","x",[4,165],5,[167,168],-0.5,5.5,[],[171,175],{"id":172,"label":173,"expression":174},"buffer","Digital buffer (idealised): output in volts","5\u002F(1 + exp(-12*(x - 2.5)))",{"id":125,"label":176,"expression":163},"Plain wire: output = input",[178,179,180],"Read the buffer's output for inputs of 3.5 V, 4.0 V and 4.5 V. How much of that 1 V spread at the input is left at the output?","Do the same for inputs of 0.5 V, 1.0 V and 1.5 V. Then look at the plain wire: what does it do with a disturbance of 1 V?","Where is the buffer's curve steep? What would happen to a small disturbance on an input resting at 2.5 V, in the middle of the forbidden zone?",{"id":182,"depth":47,"emphasis":38,"type":39,"markdown":183},"illustrate-analogy","**An everyday comparison.** Suppose you have to pass a number to a friend across a crowded room. If you hold your hand at a height that stands for the number, a small misjudgement changes the message, and each person who relays it adds an error of their own. If instead you agree on thumbs up for 1 and thumbs down for 0, the message survives a great deal of jostling, and each person who relays it makes a fresh, clear gesture. You send less with each gesture, but what you send arrives. Digital circuits make the same trade. Each wire carries only one bit at a time, so they need many wires or many steps in time, and in return the bits arrive intact.",{"kind":185,"title":186,"blocks":187},"exercise","Experiment: how much noise can a bit survive?",[188,191,232,241],{"id":189,"depth":37,"emphasis":38,"type":39,"markdown":190},"exercise-intro","The explorer below shows a signal arriving at a receiver. The horizontal axis is time and the vertical axis is voltage. The wavy curve is the arriving voltage: the level that was sent, plus noise. Real noise is irregular; here a smooth wave of adjustable size stands in for it, so that you can measure its effect. One horizontal line marks the receiver's threshold and the other marks the level as it was sent.\n\nThree sliders control the picture. **level** is the voltage the sender produced. **n** is the size of the noise: how far it pushes the voltage above and below the level. **t** is where this particular receiver's threshold happens to be, somewhere in the forbidden zone between 1.5 V and 3.5 V.\n\nThe rule for reading the plot: while the curve is above the threshold line the receiver reads 1, and while it is below, it reads 0. The bit is misread whenever the curve is on the wrong side.",{"id":192,"depth":37,"emphasis":38,"type":21,"title":193,"variable":163,"domain":194,"y_range":196,"x_label":38,"y_label":38,"parameters":199,"functions":216,"prompts":227},"exercise-noise","A noisy signal and a receiver's threshold",[4,195],4,[197,198],-2,7,[200,206,211],{"name":201,"label":202,"unit":203,"minimum":4,"maximum":165,"step":204,"initial":205},"level","level, the voltage sent","V",0.1,4.5,{"name":207,"label":208,"unit":203,"minimum":4,"maximum":209,"step":204,"initial":210},"n","n, the size of the noise",2.5,0.3,{"name":212,"label":213,"unit":203,"minimum":214,"maximum":215,"step":204,"initial":209},"t","t, the receiver's threshold",1.5,3.5,[217,221,224],{"id":218,"label":219,"expression":220},"received","Voltage arriving at the receiver","level + n*sin(9*x)",{"id":222,"label":223,"expression":212},"threshold","Receiver's threshold t",{"id":225,"label":226,"expression":201},"sent","Level as sent, without noise",[228,229,230,231],"Start with level = 4.5 (a 1), t = 2.5 and n = 0.3. The curve stays above the threshold, so the bit is read as 1. Raise n until the curve just touches the threshold line. How large is n, and how is it related to level − t?","You cannot know where a real receiver's threshold lies, so plan for the worst case. With level = 4.5, move t to 3.5 and find the n at which the curve just touches the line. That value is the noise margin for a 1.","Now send a 0: set level = 0.5. Which end of the t slider is the worst case this time? Find the n at which the curve just touches the threshold there.","Set level = 2.5, inside the forbidden zone, with t = 2.5 and n = 0.2. How many times does the curve cross the threshold? What would the receiver report for what was meant to be one steady value?",{"id":233,"depth":47,"emphasis":38,"type":22,"kind":58,"prompt":234,"options":235,"numeric":236,"hint":239,"explanation":240},"exercise-better-sender","A better sender is fitted that guarantees at least 4.8 V for a 1. Receivers still accept anything at or above 3.5 V as a 1. Using the explorer or the formula, what is the noise margin for a 1 now, in volts?",[],{"value":237,"tolerance":238,"unit":203},1.3,0.05,"Set level = 4.8 and t = 3.5 in the explorer, or subtract the receiver's limit from the sender's.","The margin is the gap between the worst voltage the sender may produce and the worst voltage the receiver still accepts: 4.8 − 3.5 = 1.3 V. In the explorer, with level = 4.8 and t = 3.5, the curve touches the threshold when n reaches 1.3. A cleaner output buys a wider margin without any change to the receiver.",{"id":242,"depth":100,"emphasis":101,"type":39,"markdown":243},"exercise-lower-supply","**Going further: lower the supply.** Many modern chips run from 3.3 V or less. Scale this lesson's illustrative limits to a 3.3 V supply in the same proportions and you get outputs of at most 0.33 V and at least 2.97 V, and inputs of at most 0.99 V and at least 2.31 V.\n\nSet level to 3.0 and t to 2.3, the nearest slider positions, and measure the margin with the n slider. You should find about 0.7 V (0.66 V with the exact figures) where the 5 V version had 1.0 V. The same disturbance now uses up a larger share of the margin, which is one reason why low-voltage circuits need more careful design.",{"kind":245,"title":246,"blocks":247},"check","Check your understanding",[248,257,279],{"id":249,"depth":37,"emphasis":38,"type":22,"kind":58,"prompt":250,"options":251,"numeric":252,"hint":255,"explanation":256},"check-margin","A logic family publishes these limits. Outputs: at most 0.4 V for a 0 and at least 2.4 V for a 1. Inputs: anything at or below 0.8 V is read as 0, and anything at or above 2.0 V is read as 1. What is the noise margin for a 0, in volts?",[],{"value":253,"tolerance":254,"unit":203},0.4,0.01,"For a 0, compare the highest voltage a sender may produce with the highest voltage a receiver still accepts as a 0.","For a 0 the sender produces at most 0.4 V and the receiver accepts up to 0.8 V, so the margin is 0.8 − 0.4 = 0.4 V. The margin for a 1 is 2.4 − 2.0 = 0.4 V as well. An answer of 1.2 V is the width of the forbidden zone (2.0 − 0.8), which is a different quantity. Answers of 1.6 V or 2.0 V come from subtracting limits that belong to different levels. These are the published limits of classic 5 V TTL logic.",{"id":258,"depth":37,"emphasis":38,"type":22,"kind":259,"prompt":260,"options":261,"numeric":38,"hint":38,"explanation":278},"check-forbidden","single","A receiver is guaranteed to read inputs at or below 1.5 V as 0 and inputs at or above 3.5 V as 1. A steady 2.6 V arrives at its input. What can you say about the bit it reads?",[262,266,270,274],{"id":263,"text":264,"correct":6,"feedback":265},"a","It reads 1, because 2.6 V is more than half of the 5 V supply.","The midpoint of the supply is not a promise. The receiver's real threshold may be anywhere between 1.5 V and 3.5 V, so on some chips 2.6 V lies below it.",{"id":267,"text":268,"correct":6,"feedback":269},"b","It reads 0, because 2.6 V has not reached the 3.5 V limit.","3.5 V is the level above which a 1 is guaranteed, not the level below which a 0 is guaranteed. A 0 is guaranteed only at or below 1.5 V.",{"id":271,"text":272,"correct":147,"feedback":273},"c","Nothing is guaranteed: it may read 0 or 1, and two chips of the same type may disagree.","Correct. 2.6 V is in the forbidden zone. The receiver will produce some output, but its specification makes no promise about which, and a little noise can flip it from one moment to the next.",{"id":275,"text":276,"correct":6,"feedback":277},"d","It reads nothing: the receiver ignores the forbidden zone and keeps its previous value.","An ordinary logic input has no memory of earlier values and no range that it ignores. It always produces some output; in the forbidden zone you cannot rely on which.","The two limits are guarantees, not a single switching point. Between them lies the forbidden zone, where the outcome depends on where this particular chip's threshold happens to be, and where a small disturbance is enough to change the result. Circuits are designed so that a settled signal is never left there.",{"id":280,"depth":37,"emphasis":38,"type":22,"kind":259,"prompt":281,"options":282,"numeric":38,"hint":38,"explanation":295},"check-chain","A bit passes through a chain of ten digital stages. Each connecting wire adds up to 0.3 V of noise, and the noise margin is 1.0 V. What happens to the bit by the end of the chain?",[283,286,289,292],{"id":263,"text":284,"correct":147,"feedback":285},"It arrives intact: each stage reads it correctly and sends on a fresh, clean level.","Correct. On every wire the disturbance (0.3 V) is smaller than the margin (1.0 V), so every stage decides correctly. Its output then starts again from a clean level, so the noise does not build up.",{"id":267,"text":287,"correct":6,"feedback":288},"It is probably misread: ten lots of 0.3 V add up to 3 V, far more than the margin.","That is what could happen in a chain that passed the exact voltage along, as an analogue chain does. A digital stage does not pass the voltage on. It passes on its decision at a fresh level, so the 0.3 V never accumulates.",{"id":271,"text":290,"correct":6,"feedback":291},"It arrives intact, because positive and negative noise always cancel out over ten stages.","Noise is not guaranteed to cancel; in a chain that passes voltages along it tends to build up. The bit survives for a different reason: each stage discards the noise it receives.",{"id":275,"text":293,"correct":6,"feedback":294},"It arrives intact only if each stage amplifies the signal tenfold.","Amplifying alone would enlarge the noise along with the signal. What matters is that each stage decides between 0 and 1 and then produces a standard level, whatever the exact input was.","This is the central advantage of digital signalling. As long as the disturbance picked up between one stage and the next stays inside the noise margin, each stage recovers the bit exactly and restores a clean level. Errors are removed stage by stage instead of being carried forward, so the length of the chain does not matter.",{"kind":297,"title":298,"blocks":299},"next","Where this leads",[300,303],{"id":301,"depth":47,"emphasis":38,"type":39,"markdown":302},"next-unlocks","With bits safely represented, you can start building things from them.\n\n- **Transistors as switches.** A transistor is the component that connects a wire to the supply or to ground, and so produces the two levels.\n- **Logic gates.** Gates such as NOT, AND and OR take bits in and give bits out, and each one restores clean levels as it does so.\n- **Timing and clocks.** Because signals need time to cross the forbidden zone and settle, digital systems agree on *when* a wire may be read.\n- **Reliable communication.** Over long or noisy links some bits are misread after all. Error-detecting and error-correcting codes deal with those.",{"id":304,"depth":47,"emphasis":101,"type":89,"tone":305,"title":306,"markdown":307},"next-try","tip","One thing to try","Find the data sheet of a logic chip, for example by searching for a part number such as 74HC00 together with the words 'data sheet'. Look for the four values $V_{OH}$, $V_{OL}$, $V_{IH}$ and $V_{IL}$ in its table of electrical characteristics and work out both noise margins. Notice that the values are given for stated conditions: a supply voltage, a temperature range and an output current.",[309,312,315,318,321,323,326,328,331,334],{"term":310,"definition":311},"bit","A value that is either 0 or 1.",{"term":313,"definition":314},"logic level","One of the two ranges of voltage, LOW or HIGH, that a digital circuit uses to stand for 0 and 1.",{"term":316,"definition":317},"ground","The point in a circuit chosen as the 0 V reference, against which other voltages are measured.",{"term":319,"definition":320},"supply voltage","The voltage that powers a circuit, for example 5 V. In this lesson a logic HIGH is a voltage close to it.",{"term":222,"definition":322},"The input voltage at which a receiver's decision changes between 0 and 1. Its exact value varies from chip to chip.",{"term":324,"definition":325},"forbidden zone","The range of input voltages between the guaranteed-0 limit and the guaranteed-1 limit, where the receiver's reading is not guaranteed. Also called the undefined region.",{"term":129,"definition":327},"Any unwanted disturbance added to a signal, for example from neighbouring wires or from the power supply.",{"term":329,"definition":330},"noise margin","The largest disturbance a signal can suffer between sender and receiver and still be guaranteed to be read correctly.",{"term":332,"definition":333},"logic family","A group of chips built with the same technology and sharing the same voltage limits, so that they can be connected to one another directly.",{"term":172,"definition":335},"A digital stage whose output bit equals its input bit. It restores a clean voltage level.",[],"47efdf57870d3c10306113b4604eaf6a28d4efe6893b58c47ba11a84abb16e6d","2026-10-20T20:13:41.445616Z",{"origin":340,"reviewed":6,"flagged":6,"note":341,"concept_known":38},"curated","Sample lesson. The voltage limits used here (0.5 V, 1.5 V, 3.5 V and 4.5 V on a 5 V supply) are round, illustrative figures in the style of CMOS logic; real logic families publish their own limits. Noise is drawn as a smooth wave for clarity; real noise is irregular.",{"check":343,"tutor":365,"challenge":372,"explanations":378,"more":487},{"turns":344},[345,348,351,353,355,357,359,361,363],{"role":346,"content":347},"examiner","Hello, and well done for reaching the end of the lesson. This is just a relaxed conversation of a few minutes about how you think of the idea: nothing is graded and there is no pressure at all. To start, how would you explain in your own words how a wire, which always carries some voltage, can stand for just a 0 or a 1?",{"role":349,"content":350},"student","The sender and the receiver agree on two ranges instead of exact values. Anything low, close to 0 V, counts as a 0, and anything high, close to the supply, counts as a 1. With the lesson's numbers the receiver reads 1.5 V or less as 0 and 3.5 V or more as 1, and the bit in between is the forbidden zone, where nothing is promised, so a circuit shouldn't leave a signal sitting there.",{"role":346,"content":352},"Thank you. Why does the agreement have to be about ranges at all? Why not have the receiver look for exactly 0 V and exactly 5 V?",{"role":349,"content":354},"Because no real circuit ever hits an exact value. Parts vary, wires have resistance and nearby signals push the voltage around, so a rule that needed exactly 5 V would basically never be met. With ranges, the reading survives all that small wobble.",{"role":346,"content":356},"That's clear, thank you. Now a different angle: a copy of a copy of a cassette tape gets more hiss each time, while a file copied a thousand times comes out the same. How would you explain that difference using what happens at each digital stage?",{"role":349,"content":358},"The tape copies the exact signal, hiss and all, so every copy adds its own noise on top of the last one's. A digital stage only asks high or low, makes its decision, and then sends out a fresh, full-strength level. So as long as the noise picked up on each step is smaller than the margin, it gets thrown away every time instead of piling up.",{"role":346,"content":360},"You said as long as the noise is smaller than the margin. With the lesson's numbers, what would you expect if a 1 left the sender at 4.5 V and picked up 1.2 V of interference on the way down?",{"role":349,"content":362},"It would arrive at 3.3 V, which is just below 3.5 V, so it's in the forbidden zone. Some receivers might still read a 1, but nothing guarantees it, because 1.2 V is more than the 1.0 V noise margin. So the clean-up at each stage only works while the disturbance stays inside the margin.",{"role":346,"content":364},"Thank you, that's the end of this check. You explained why the agreement has to be two ranges with a gap between them, and you showed how each stage throws away noise smaller than the margin by sending a fresh level, while a larger disturbance leaves the bit unguaranteed. The idea seems to be yours, and the skill's Mastery Check is where you demonstrate it.",{"turns":366},[367,369],{"role":349,"content":368},"Why does the sender have to put out at least 4.5 V for a 1 when the receiver would accept anything from 3.5 V up? Isn't that extra volt just wasted?",{"role":370,"content":371},"tutor","What might happen if the sender put out exactly 3.5 V and interference pulled it down a little?\n\nThat extra volt is a safety cushion: with the lesson’s limits, a sender’s 1 can be disturbed downward by up to 1.0 V and still arrive at 3.5 V, which the receiver is guaranteed to read as 1. It’s not extra information—it’s protection against noise.",{"turns":373},[374,376],{"role":349,"content":375},"Digital circuits use two voltage ranges for 0 and 1, with a forbidden zone between them, because each chip's real threshold sits somewhere in that gap and you don't know where. Senders have to produce levels well clear of the receiver's limits, and the gap between what's sent and what's accepted is the noise margin, 1.0 V with the lesson's numbers. Any disturbance smaller than that can't change the bit, and because every stage sends on a fresh level, the noise doesn't add up from one stage to the next.",{"role":370,"content":377},"You’ve got the key idea right: the receiver’s guaranteed ranges leave a forbidden zone, the example gives a 1.0 V margin on either side, and a valid input is regenerated by the next stage rather than passing along its exact voltage.\n\nThe weakest point is “every stage sends on a fresh level”: that protection depends on the receiver getting a valid input. If a 1 sent at 4.5 V is pulled down by 1.3 V, the receiver sees 3.2 V. What can you conclude about what it reads—and whether its output restores a reliable 1?",[379,385,401,407,413,446],{"mode":380,"blocks":381},"simpler",[382],{"id":383,"depth":37,"emphasis":38,"type":39,"markdown":384},"ex-simpler-1","A wire can carry a 0 or a 1 using two voltage ranges. Near 0 V means 0. Near 5 V means 1.\n\nThe receiver accepts a low voltage as 0 and a high voltage as 1. With the example values here, it is sure to read 0 at 1.5 V or less, and 1 at 3.5 V or more. Between those levels, the result is uncertain.\n\nThe sender uses levels farther from that uncertain gap: at most 0.5 V for 0, and at least 4.5 V for 1. This leaves a 1 V noise margin on either side. So small disturbances can change the voltage without changing the bit the receiver reads.\n\nIt is like using a very quiet voice for one signal and a very loud voice for another in a room with background noise. If the noise is small, the listener can still tell them apart. A voice in between is harder to judge.",{"mode":386,"blocks":387},"worked_example",[388,391,396],{"id":389,"depth":37,"emphasis":38,"type":39,"markdown":390},"ex-worked-example-1","**Example: sending a 1**\nAssume the illustrative 5 V circuit in the section. The sender and receiver need an agreement because a wire’s voltage can vary: **near 0 V means 0, and near 5 V means 1**. The receiver’s threshold can vary too, so the guarantee is given as ranges: it accepts a 1 at **3.5 V or above**, and a 0 at **1.5 V or below**. Between those limits is a forbidden zone, where the receiver’s reading is not guaranteed.\n\n1. **Start with a valid sender output.** The sender puts out **4.5 V**, the lowest level it is allowed to use for a 1. This leaves room for the voltage to be disturbed before it reaches the receiver.\n2. **Apply the interference.** A neighbouring wire pulls the voltage down by **0.7 V**, so the receiver sees **4.5 − 0.7 = 3.8 V**.\n3. **Check the receiver’s guarantee.** Since **3.8 V is above 3.5 V**, it is in the guaranteed-1 range. The receiver reads a **1**. The voltage was changed, but not enough to change the bit.\n4. **Pass the bit on.** The receiver drives a fresh output of **4.5 V or more** for a 1. It does not pass along the disturbed 3.8 V; the disturbance is discarded at this stage.\n\nThat is why digital circuits can tolerate some noise: the sender’s output starts well inside the receiver’s accepted range, leaving a noise margin. In this example the high margin is **4.5 − 3.5 = 1.0 V**. A disturbance of 0.7 V is smaller than that margin, so the 1 is still guaranteed.",{"id":392,"depth":47,"emphasis":158,"type":80,"latex":393,"spoken":394,"caption":395},"ex-worked-example-2","V_{NMH}=V_{OH}-V_{IH},\\qquad V_{NML}=V_{IL}-V_{OL}","High noise margin equals V O H minus V I H; low noise margin equals V I L minus V O L.","For the illustrative limits, both margins are 1.0 V.",{"id":397,"depth":47,"emphasis":38,"type":89,"tone":398,"title":399,"markdown":400},"ex-worked-example-3","caution","The margin is not unlimited","If the same 4.5 V output were pulled down by 1.3 V, the receiver would see **3.2 V**. That is between 1.5 V and 3.5 V, in the forbidden zone. The section gives no guaranteed reading there, so we cannot say the receiver will read a 1.",{"mode":402,"blocks":403},"analogy",[404],{"id":405,"depth":37,"emphasis":38,"type":39,"markdown":406},"ex-analogy-1","**Analogy:** Think of a sender placing a ball on one of two broad shelves: the low shelf stands for 0, and the high shelf for 1. A receiver can reliably tell which shelf the ball is on even if it gets jostled a little. The gap between the shelves is a no-man’s-land: if the ball ends up there, the receiver’s decision is not guaranteed. The sender places the ball well inside a shelf, leaving room for noise. With the section’s illustrative limits, a 1 sent at 4.5 V can fall by 1.0 V and still be at the receiver’s guaranteed-1 limit of 3.5 V. The receiver then drives a fresh, full-strength 1 onward rather than passing along the small disturbance.\n\n**Where the analogy stops being true:** A circuit has no literal shelves or ball. It uses voltage ranges and a chip-specific threshold to interpret an electrical input. The region between 1.5 V and 3.5 V in this example has no guaranteed interpretation; the receiver may read either value. The shelf picture only illustrates the ranges, the room for noise, and the idea of restoring a signal.",{"mode":408,"blocks":409},"socratic",[410],{"id":411,"depth":37,"emphasis":38,"type":39,"markdown":412},"ex-socratic-1","1. If a circuit uses a wire to carry a bit, what two voltage levels could the sender and receiver agree to interpret as 0 and 1?\n2. Why might it be safer to agree on voltage ranges rather than require exactly 0 V or exactly 5 V?\n3. If a receiver accepts LOW below one limit and HIGH above another, what could happen to a voltage in the gap between those limits?\n4. How do the sender’s output limits and the receiver’s input limits leave room for a voltage disturbance—and what happens to that disturbance when a receiver passes the bit to the next stage?",{"mode":414,"blocks":415},"deeper_math",[416,419,422,425,428],{"id":417,"depth":37,"emphasis":158,"type":39,"markdown":418},"ex-deeper-math-1","A digital input does not need an exact voltage; it needs to fall within a range the receiver guarantees how to interpret. For the illustrative 5 V circuit, an input at or below $V_{IL}=1.5\\text{ V}$ is guaranteed to mean LOW (0), and one at or above $V_{IH}=3.5\\text{ V}$ is guaranteed to mean HIGH (1). Between those limits, the receiver's interpretation is unspecified. This is the forbidden, or undefined, zone.",{"id":420,"depth":37,"emphasis":158,"type":80,"latex":81,"spoken":394,"caption":421},"ex-deeper-math-2","Margins measure how far a sender’s guaranteed output is from the receiver’s uncertain boundary.",{"id":423,"depth":47,"emphasis":158,"type":39,"markdown":424},"ex-deeper-math-3","The sender guarantees $V_{OH}\\ge 4.5\\text{ V}$ for HIGH and $V_{OL}\\le 0.5\\text{ V}$ for LOW. The receiver guarantees HIGH for inputs at least $3.5\\text{ V}$ and LOW for inputs at most $1.5\\text{ V}$. Therefore, the worst-case margins are:\n\n- HIGH: $4.5-3.5=1.0\\text{ V}$. A HIGH can be lowered by up to 1.0 V and still meet the guaranteed HIGH limit.\n- LOW: $1.5-0.5=1.0\\text{ V}$. A LOW can be raised by up to 1.0 V and still meet the guaranteed LOW limit.\n\nThese margins are why a limited amount of noise need not change the bit. They are guarantees only while the received voltage remains in the corresponding guaranteed input range.",{"id":426,"depth":47,"emphasis":101,"type":39,"markdown":427},"ex-deeper-math-4","For a sender outputting the minimum allowed HIGH, $4.5\\text{ V}$, a $0.7\\text{ V}$ downward disturbance gives $4.5-0.7=3.8\\text{ V}$. Since $3.8\\text{ V}\\ge 3.5\\text{ V}$, the receiver is guaranteed to read HIGH. A $1.3\\text{ V}$ downward disturbance instead gives $3.2\\text{ V}$, which lies in the undefined zone; the specification no longer guarantees the reading. When the receiver passes on the bit, its output is driven to a fresh guaranteed level, so the incoming $0.7\\text{ V}$ disturbance is not passed along as part of the output voltage.",{"id":429,"depth":37,"emphasis":158,"type":22,"kind":259,"prompt":430,"options":431,"numeric":38,"hint":444,"explanation":445},"ex-deeper-math-5","Using the illustrative limits, a sender outputs a LOW at its highest allowed level, $0.5\\text{ V}$. Noise raises the input by $0.8\\text{ V}$. What does the receiver’s specification guarantee?",[432,436,440],{"id":433,"text":434,"correct":147,"feedback":435},"low-guaranteed","LOW, because the input is $1.3\\text{ V}$, at or below $1.5\\text{ V}$.","Correct. The input is within the guaranteed LOW range.",{"id":437,"text":438,"correct":6,"feedback":439},"high-guaranteed","HIGH, because noise raised the voltage.","The direction of the disturbance does not determine the bit; the resulting voltage must be compared with the guaranteed ranges.",{"id":441,"text":442,"correct":6,"feedback":443},"undefined","No guaranteed reading, because any noise makes the signal undefined.","Noise is tolerated as long as the resulting voltage stays within the relevant guaranteed input range.","Add the upward disturbance to the sender’s output, then compare the result with $V_{IL}$.","$0.5+0.8=1.3\\text{ V}$. Since this is at or below $V_{IL}=1.5\\text{ V}$, the receiver is guaranteed to read LOW.",{"mode":447,"blocks":448},"visual",[449,452,478,483],{"id":450,"depth":37,"emphasis":101,"type":39,"markdown":451},"ex-visual-1","Picture a wire with two safe bands of voltage, not two exact values. In this lesson’s illustrative 5 V example, a sender outputs a 0 at **0.5 V or less** and a 1 at **4.5 V or more**. A receiver is guaranteed to read 0 at **1.5 V or less** and 1 at **3.5 V or more**.\n\nBetween **1.5 V and 3.5 V** is the forbidden, or undefined, zone: the receiver’s result is not guaranteed. Its exact switching threshold can vary, so a reliable circuit keeps signals out of that zone.",{"id":453,"depth":37,"emphasis":101,"type":114,"title":454,"description":455,"kind":117,"direction":456,"nodes":457,"edges":471},"ex-visual-2","A bit survives noise, then is restored","Follow a HIGH bit from sender to receiver. The receiver accepts 3.8 V as HIGH, then drives a fresh HIGH output for the next stage.","right",[458,461,464,467],{"id":121,"label":459,"detail":460,"group":38},"Sender: HIGH","At least 4.5 V",{"id":125,"label":462,"detail":463,"group":38},"Wire + noise","Interference pulls 4.5 V down by 0.7 V",{"id":133,"label":465,"detail":466,"group":38},"Receiver input","Sees 3.8 V; at least 3.5 V is guaranteed HIGH",{"id":468,"label":469,"detail":470,"group":38},"restored","Fresh output","Receiver drives a new HIGH at 4.5 V or more",[472,474,476],{"source":121,"target":125,"label":473,"directed":147},"4.5 V",{"source":125,"target":133,"label":475,"directed":147},"3.8 V",{"source":133,"target":468,"label":477,"directed":147},"reads 1, drives HIGH",{"id":479,"depth":37,"emphasis":158,"type":80,"latex":480,"spoken":481,"caption":482},"ex-visual-3","V_{NH}=V_{OH}-V_{IH}=4.5-3.5=1.0\\,\\text{V},\\qquad V_{NL}=V_{IL}-V_{OL}=1.5-0.5=1.0\\,\\text{V}","High noise margin equals V O H minus V I H; low noise margin equals V I L minus V O L. In this example, both margins are one volt.","Illustrative 5 V limits: the margin is the voltage disturbance available before the edge of the receiver’s guaranteed range is reached.",{"id":484,"depth":37,"emphasis":101,"type":89,"tone":90,"title":485,"markdown":486},"ex-visual-4","Noise is not passed along as the same voltage","In the example, a 0.7 V disturbance lowers a sender’s 4.5 V HIGH to 3.8 V. Since 3.8 V is above the receiver’s 3.5 V HIGH limit, the receiver is guaranteed to read 1. It then drives a fresh HIGH output, so the original disturbance is not handed on as a weakened signal.\n\nThe 1.0 V noise margin is the amount of disturbance allowed by these example limits while staying within the guaranteed reading range.",{"blocks":488},[489,492],{"id":490,"depth":47,"emphasis":158,"type":39,"markdown":491},"ex-more-1","**Why a gate can clean up a signal**\nA wire does not repair a noisy voltage. **A logic gate can**, provided its input is still within a guaranteed LOW or HIGH range. The gate’s voltage-transfer characteristic maps a broad range of input voltages to a much narrower output range: a valid LOW produces a LOW output, and a valid HIGH produces a HIGH output. This is the physical basis of *signal regeneration*. In a chain of gates, small disturbances therefore need not accumulate from stage to stage; each gate produces a fresh output. But a disturbance that pushes an input into the undefined region removes that guarantee.\n\nThe stated noise margins are static voltage allowances, not protection against every kind of interference. A brief spike can matter even if its average voltage is harmless, and timing, loading, supply variation, and the shape and duration of a disturbance also affect real circuits. For example, standard 74HC CMOS logic datasheets specify input limits in relation to the supply voltage; the precise limits and output guarantees depend on the particular part and operating conditions. Engineers check those specifications across each connection, rather than assuming every circuit uses the illustrative 5 V limits above.",{"id":493,"depth":47,"emphasis":101,"type":89,"tone":398,"title":494,"markdown":495},"ex-more-2","A margin is a budget, not immunity","Noise margin says how much a valid output level can be disturbed while remaining in the next receiver’s guaranteed range. It does not make an undefined input safe, nor guarantee that a narrow pulse will be ignored. If a flip-flop samples a signal close to its timing boundary, it can also become metastable—a timing problem distinct from the ordinary uncertainty of a combinational gate’s response to an out-of-range voltage.",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":497},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m12 19l-7-7l7-7m7 7H5\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":499},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M15 14c.2-1 .7-1.7 1.5-2.5c1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5c.7.7 1.3 1.5 1.5 2.5m0 4h6m-5 4h4\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":501},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h14m-7-7v14\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":503},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h14m-7-7l7 7l-7 7\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":505},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m6 9l6 6l6-6\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":507},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092a10 10 0 1 0-4.777-4.719\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":509},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m13 19l6-6m-4.5 4.5L3.586 6.586A2 2 0 0 1 3 5.172V3h2.172a2 2 0 0 1 1.414.586L17.5 14.5m-2.672-8.328l2.586-2.586A2 2 0 0 1 18.828 3H21v2.172a2 2 0 0 1-.586 1.414l-2.586 2.586M16 16l4 4m-1 1l2-2M5 14l4 4m-4 3l-2-2m4.5-2.5L4 20\"\u002F>"]