lectures.alex.balgavy.eu

Lecture notes from university.
git clone git://git.alex.balgavy.eu/lectures.alex.balgavy.eu.git
Log | Files | Refs | Submodules

Addition_subtraction logic unit.html (3119B)


      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      3 <html><head><link rel="stylesheet" href="sitewide.css" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="exporter-version" content="Evernote Mac 6.13.1 (455785)"/><meta name="altitude" content="-0.6985639929771423"/><meta name="author" content="Alex Balgavy"/><meta name="created" content="2017-12-05 4:39:55 PM +0000"/><meta name="latitude" content="52.33421727619561"/><meta name="longitude" content="4.867580131602151"/><meta name="source" content="desktop.mac"/><meta name="updated" content="2017-12-05 5:03:41 PM +0000"/><title>Addition/subtraction logic unit</title></head><body><div><b>Adders</b></div><div>A half adder takes two inputs, produces sum and carry-out.</div><div>A full adder also takes a carry-in.</div><div><br/></div><div>You can easily get this from a truth table:</div><div><img src="Addition_subtraction%20logic%20unit.resources/screenshot.png" height="56" width="355"/></div><div><br/></div><div>You can make a circuit out of this. Inputs are x, y, and carry. Carry out is c<sub>i+1</sub>:</div><div><table style="border-collapse: collapse; min-width: 100%;"><colgroup><col style="width: 201px;"/><col style="width: 335px;"/></colgroup><tbody><tr><td style="border: 1px solid rgb(219, 219, 219); background-color: rgb(255, 255, 255); width: 201px; padding: 8px;"><div>Sum:</div><div><img src="Addition_subtraction%20logic%20unit.resources/screenshot_3.png" height="104" width="179"/></div></td><td style="border: 1px solid rgb(219, 219, 219); background-color: rgb(255, 255, 255); width: 335px; padding: 8px;"><div>Carry:</div><div><img src="Addition_subtraction%20logic%20unit.resources/screenshot_4.png" height="183" width="251"/></div></td></tr></tbody></table><div><br/></div></div><div>That’s represented by the symbol:</div><div><img src="Addition_subtraction%20logic%20unit.resources/Screen%20Shot%202017-12-05%20at%205.56.28%20PM.png" height="190" width="241"/></div><div><br/></div><div>If you want to add n bits, you stick a bunch of them together and make an <i>n</i>-bit ripple-carry adder. x<sub>n-1</sub> and y<sub>n-1</sub> are the sign bits:</div><div><br/></div><div><img src="Addition_subtraction%20logic%20unit.resources/screenshot_1.png" height="219" width="620"/></div><div><br/></div><div><br/></div><div><b>Detecting overflow</b></div><div>Remember that the final carry out is not a part of the result.</div><div>It’s an overflow when:</div><div><ul><li>the sign of the sum is different from the sign of the summands</li><li>or the carry-out bits are different</li></ul><div><br/></div></div><div>Two logical expressions for detecting overflow (either works):</div><div><img src="Addition_subtraction%20logic%20unit.resources/466215F1-2DA6-4029-9FB6-43499ABD7D87.png" height="33" width="298"/></div><div><img src="Addition_subtraction%20logic%20unit.resources/screenshot_2.png" height="17" width="68"/></div><div><br/></div><div><br/></div><div><br/></div></body></html>