CS 231 Intro & Base ConversionsAnnouncementsTips for CS 231Slide 4Digits vs. bitsBinary to decimalDecimal to binarySlide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Hexadecimal baseSlide 17Binary to HexOctal baseSlide 20Binary to OctalOther conversionsSummaryBasic Boolean OperationsCircuit AnalysisBoolean expressionsTruth TableSimplification with axiomsSlide 29CS 231Intro & Base ConversionsSangkyum KimSep 1, 2006AnnouncementsMallard is up. If you already registered but cannot log on, let me know it. Sometimes course webpage is downMallard link (https://mallard2.cites.uiuc.edu/CS231/)First homework assignment is released Due: 9/11(Mon) 5:00pm inside SC 0212Tips for CS 231Don’t hesitate to:Ask questionsInterrupt when you don’t understandBe comfortable with binary and hexLearn device inputs & outputsAllows abstractionEasier to understandTips for CS 231Efficiency is important!Neatness is important!Unreadable solutions are considered wrongReadable ones are neat, short (big favor for both you and the graders)Digits = powers of 10… 100, 10, 1,1/10,1/100,1/1000 …… 102, 101, 100, 10-1, 10-2, 10-3 …Ex: (36.25)10 = 3*10 + 6*1 + 2*1/10 + 5* 1/100Bits = powers of 2… 8, 4, 2, 1,1/2,1/4,1/8 …… 23, 22, 21, 20, 2-1, 2-2, 2-3 …Ex: (100100.01)2 = 1*32 + 1*4 + 1* 1/4Digits vs. bitsBinary to decimaladd powers that have a 1(101001)2 = 32 + 8 + 1(0.1001)2 = 1/2 + 1/16(10110.1011)2 = ?16 + 4 + 2 + 1/2 + 1/8 + 1/16= 22.6875Decimal to binaryLeft of decimal pointRepeatedly divide integer part by 2 until you get 0Read remainders bottom to up22 = (?)22211 R 05 R 12 R 11 R 00 R 1Decimal to binaryLeft of decimal pointRepeatedly divide integer part by 2 until you get 0Read remainders bottom to up22 = (10110)22211 R 05 R 12 R 11 R 00 R 1Decimal to binaryRight of decimal pointRepeatedly multiply fractional part by 2 until you get 1Read integer portion top to bottom0.8125 = (?)20.81251.62501.250.51.0Decimal to binaryRight of decimal pointRepeatedly multiply fractional part by 2 until you get 1Read integer portion top to bottom0.8125 = (0.1101)20.81251.62501.250.51.0Decimal to binaryWhat if there are both left and right of the decimal point?Do them separately and combine22.8125 = (?)2Decimal to binaryWhat if there are both left and right of the decimal point?Do them separately and combine22.8125 = (?)22211 R 05 R 12 R 11 R 00 R 10.81251.62501.250.51.0Decimal to binaryWhat if there are both left and right of the decimal point?Do them separately and combine22.8125 = (10110.1101)22211 R 05 R 12 R 11 R 00 R 10.81251.62501.250.51.0up downDecimal to binaryToy example 3.25 = (?)231 R 10 R 10. 250.501.0Decimal to binaryToy example 3.25 = (11.01)231 R 10 R 10. 250.501.0Hexadecimal baseHex digits = powers of 16… 256, 16, 1,1/16,1/256 …… 162, 161, 160, 16-1, 16-2 …use digits 0-9, A-FA=10, B=11, C=12, D=13, E=14, F=15often preceded by 0xbook subscript notation (24.4)16Ex: (24.4)16 = 2*16 + 4*1 + 4* 1/16Hexadecimal baseHex (hexadecimal)Hex digit is a group of 4 bitsMemorize this table!!dec. hex binary0 0 00001 1 00012 2 00103 3 00114 4 01005 5 01016 6 01107 7 01118 8 10009 9 100110 A 101011 B 101112 C 110013 D 110114 E 111015 F 1111Hex (hexadecimal)Group from decimal point outwardPad with zeros to get groups of 4(1101101001010.101001)2(0001 1011 0100 1010 . 1010 0100)2 1 B 4 A . A 4(1101101001010.101001)2 = (1B4A.A4)16Binary to HexOctal digits = powers of 8… 64, 8, 1,1/8,1/64 …… 82, 81, 80, 8-1, 8-2 …use digits 0-7sometimes preceded by 0book subscript notation (24.4)8Ex: (44.2)8 = 4*8 + 4*1 + 2* 1/8Octal baseOctalOctal digits are groups of 3 bitsPad with zerosdec. octal binary0 0 0001 1 0012 2 0103 3 0114 4 1005 5 1016 6 1107 7 111Octal baseOctalGroup from decimal point outwardPad with zeros to get groups of 3(1101101001010.101001)2(001 101 101 001 010 . 101 001)2 1 5 5 1 2 . 5 1(1101101001010.101001)2 = (15512.51) 8Binary to OctalWhat about other conversions such as:Octal HexDecimal Hex…Use other conversions you already knowOctal Binary HexDecimal Binary HexOther conversionsI. Decimal BinaryBinary DecimalII. Binary HexBinary OctalIII. Other conversionsUse the conversions you already knowSummaryBasic Boolean Operationsx y xy0 0 00 1 01 0 01 1 1x y x+y0 0 00 1 11 0 11 1 1x x’0 11 0AND (product)of two inputsOR (sum) of two inputsNOT(complement)on one inputxy, or x-y x + y x’Operation:Expression:Truth table:Logic gate:Circuit AnalysisCircuit analysis involves figuring out what some circuit does.Every circuit computes some function, which can be described with Boolean expressions or truth tables.The first thing to do is figure out what the inputs and outputs of the overall circuit are.Boolean expressionsWe did a little simplification for the top AND gate.You can see the circuit computes f(x,y,z) = xz + y’z + x’yz’Truth Tablex y z f0 0 0 00 0 1 10 1 0 10 1 1 01 0 0 01 0 1 11 1 0 01 1 1 1Simplification with axiomsx’y’ + xyz + x’y= x’(y’ + y) + xyz [ Distributive; x’y’ + x’y = x’(y’ + y) ]= x’-1 + xyz [ Axiom 7; y’ + y = 1 ]= x’ + xyz [ Axiom 2; x’-1 = x’ ]= (x’ + x)(x’ + yz) [ Distributive ]= 1 - (x’ + yz) [ Axiom 7; x’ + x = 1 ]= x’ + yz [ Axiom 2 ]1. x + 0 = x 2. x - 1 = x3. x + 1 = 1 4. x - 0 = 05. x + x = x 6. x - x = x7. x + x’ = 1 8. x - x’ = 09. (x’)’ = x10. x + y = y + x 11. xy = yx Commutative12. x + (y + z) = (x + y) + z 13. x(yz) = (xy)z Associative14. x(y + z) = xy + xz 15. x + yz = (x + y)(x + z) Distributive16. (x + y)’ = x’y’ 17. (xy)’ = x’ + y’ DeMorgan’sSimplification with axiomsyz + y(x+z)’ + x(x+y)= y + x1. x + 0 = x 2. x - 1 = x3. x + 1 = 1 4. x - 0 = 05. x + x = x 6. x - x = x7. x + x’ = 1 8. x - x’ = 09. (x’)’ = x10. x + y = y + x 11. xy = yx Commutative12. x + (y + z) = (x + y) + z 13. x(yz) = (xy)z Associative14. x(y + z) = xy + xz 15. x + yz = (x + y)(x + z) Distributive16. (x + y)’ = x’y’ 17. (xy)’ = x’ + y’
View Full Document