Docsity

Numbers Systems - logic design, Lecture notes of Digital Logic Design and Programming

Partial preview of the text

Download Numbers Systems - logic design and more Lecture notes Digital Logic Design and Programming in PDF only on Docsity!

MA 9 —ONOTES DIGITAL LOGIC DESIGN - LECTURE 2 \ | WHAT'S INSIDE G)- Decimal & Binary Place values - binary 2 decimal, two methods Hexadecimal Bits vs. combinations - 3 solved conversions Unsigned and signed n-bit ranges GS (3)- Octal & Number Ranges © Binary Arithmetic Addition - overflow - subtraction with complements v 4pages yv handwritten vy colour-coded yv solved example? Original summary by MA Notes - please don’t share or resell CDigits Base / radian) Decima\ System (O.\, ----,%) diaits Positional CXS per 1 \ IW lo! > \0 weights ot she Position L base Dinar y System (0,1) digits fadin 3 2 aes (40 1110), YX 224 8+442 =(4p) = in decimal Sustem To convert rom binary > decimal & sum of -the multiplication of each vio. with its weight To convert Crom decimal fy binaty 8 Xs ‘ 351 > if we aff still able ners to subtract ftom the no ex: 354 fo _binaty without it becomes negative —> will we Gack Another Wav, aoe Loo 1 | 357 |*2 aro | 18 1 | 34 O} 44 O} 22 ty {| 9 \we Oo; 2 Ny A 0 digits 8 (0,! -----,4) Tadix 2 & ts) binary its ens fol (312\)s=(ol WV ol 00\ ), oe Wl ‘ 00 Q4) Convert Lrotoyo 1) 211101190 cot ),. 4, octal C1 32735 4Ds Panag & 10. of n_ bis n bits > 2° combinations Unsigned numbers s (+ve) 5Bbts — O-3) 6 bits —a» O7255 w_bit, —> o»2-\ > Fanag. at uncioned mambers Signed numbers « “4 bits lb Comloinactions 8 oe SS 8g -§ => -{. | -8 — { nN bits Z 4 -2"" = 2 -{ — Tange of Soned numbers Adhikion in onary es (| LO tT G0\\O _ — TT bt | 018 1\O \0 | N bits overt Pow ~ to V AA + N\_ bits Lo 010g (nx!) bits Subtraction { 000 4 {< Complement G4 | — oltolit _7 {0100 ee : _— — Complement 23 +{ = 29 (OVO) * yo 0 O\ ‘O01 10 \ 43 + 99 | v9 \ M58 —> O— +e C cart out») {Ne Here's the order of steps for subtraction: 1. Take the 2's complement of the number you're subtracting. Don't check its sign. It's just the value that stands for —B. 2. Add it to the other number. The sum may be one bit longer than n. 3. Check for a carry out (the extra bit on the far left). This tells you the sign of the result: o Carry out = 1: the result is positive. Drop the carry, and the remaining n bits are the answer. ° Nocarry out: the result is negative. The n bits are the answer in 2's complement form, so the MSB will be 1. Take the 2's complement again to get the magnitude. Example with 5 bits, 10001 — 01011 (17 — 11): e 2's complement of 01011 is 10101. e 10001 + 10101 = 100110. There's a carry out, so the result is positive. Drop the carry: 00110 = 6. The MSB is 0, which agrees. Example with 5 bits, 01011 — 10001 (11 - 17): e 2's complement of 10001 is 01111. e 01011 + 01111 = 11010. There's no carry out, so the result is negative. The MSB is 1, which agrees. The value is —6. So the carry out decides whether you dropai “ ad the MSBof the final n bits tells you the sign.