1 / 94

CS 105 Digital Logic Design

Sem1-1436-1437. Chapter 1. CS 105 Digital Logic Design. Lecturer Fawziah Alqahtani. Contents. Communication Course Information. Text book. Grades. Exams dates. Topics to be covered. Digital Systems and Computer Systems Information Representation

dickison
Download Presentation

CS 105 Digital Logic Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sem1-1436-1437 Chapter 1 CS 105Digital Logic Design Lecturer Fawziah Alqahtani

  2. Contents • Communication • Course Information. • Text book. • Grades. • Exams dates. • Topics to be covered. • Digital Systems and Computer Systems • Information Representation • Number Systems [binary, octal and hexadecimal]

  3. Communication Office hours (7 hours per Week): • Sunday (9-9:50) & (2:30 – 4:00). • Tuesday (9-9:50) & (2:30 – 4:00). • Thursday (9-9:50). E-mail: • iamfawziah@yahoo.com E-Learning: • Blackboard

  4. Textbook “DIGITAL DESIGN”, by Mano M. Morris, 4th edition, Prentice- Hall.

  5. Midterm Dates & Grades Check the handout!

  6. Conduct in Class • Don’t distract the students. I don’t insist that you pay attention, but you must allow others to participate. This ‎means: ‎ • Do not distract others with conversation.‎ • Do not distract others with your phone.‎ • Do not distract others by using your laptop in front of the class.‎ • If you snore, I will wake you up. ‎ • Do not attend the class late; you have only 10 minutes to attend it. Otherwise, you will be marked absent on ‎that day.‎ • There are no makeup quizzes (if you miss a quiz, you will get zero for that quiz).‎ Computer Science Department

  7. Rules of e-mail messages: • Write your message in paschal Arabic (NOT in slang Arabic). • In the email Subject, you have to write: • Course#- Section# - full Name – brief description for the email , for example: CS105D-1C10 – Nora AlAhmad – about sheet 1 CS105D-11C12– Sara AlAli – about ............. • In general, subject should summarize the message. • We will not reply to any email that contains something like: ????? !!!!! , or هاااااااااااام or أرجو الرد,or any impolite words. • If you violate any one of the above rules, your email will not be opened. • NOTE: Send the email from your @pnu.edu.sa address only. Computer Science Department

  8. Computer Science Department

  9. Topics

  10. Chapter 1 Outline 1.1 Digital Systems 1.2 Binary Numbers 1.3 Number-Base Conversions 1.4 Octal and Hexadecimal Numbers 1.5 Complements 1.6 Signed Binary Numbers 1.7 Binary Codes

  11. 1.1 Digital Systems (1-2) • Digital system is a system that uses discrete values such as numbers and letters. • The signal in most digital systems use two values : • 0 and 1 which called a bit. • Discrete elements of information are represented with a group of bits called binary codes. • Thus, Digital system is a system that manipulates discrete elements of information represented internally in binary form.

  12. Arithmetic & data processing operations 1.1 Digital Systems (2-2) Central Processing Unit Stores programs, inputs, outputs & intermediate data Receives results of computations and prints them to user Memory Unit Data and program prepared by user Output Unit Input Unit Block diagram of a digital Computer

  13. j = - 1 i = n - 1 å å + i j (Number)r = A r A r i j i = 0 j = - m (Integer Portion) (Fraction Portion) + 1.2 Binary Numbers Number Systems – Representation • Positive radix, positional number systems • A number with radixr is represented by a string of digits:An - 1An - 2 … A1A0 . A- 1 A- 2 … A- m +1 A- min which 0 £ Ai < r and . is the radix point. • The string of digits represents the power series: ( ) ( )

  14. 1.2 Binary Numbers (Cont.) In general, a number expressed in a base-r system has coefficients multiplied by powers of r: An-1.rn-1 + An-2.rn-2 + ....... + A2.r2+ A1.r + A0+ A-1.r-1+ A-2.r-2+ .......... + a-m.r-m • ris called base or radix. • Ajranges in thr value from 0 to r-1

  15. 1.3 Number-Base Conversions (1-6) Base r – to – Decimal Conversion Rule: an.rn + an-1.rn-1 + ....... + a2.r2 + a1.r + a0 + a-1.r-1 + a-2.r-2+ .......... + a-m.r-m an.rn + an-1.rn-1 + ....... + a2.r2 + a1.r + a0 Integral part a-1.r-1 + a-2.r-2 + ....... + a-m.r-m Fractional part Integral part Fractional part Result

  16. 1.3 Number-Base Conversions (2-6) Base r – to – Decimal Conversion Example: Find the decimal equivalent ofthe binary number (1001.0101)2. 1001 = 1 x 23 + 0 x 22 + 0 x 21 + 1 x 20 = 8+0+0+1=9 Integral part .0101 = 0 x 2-1+ 1 x 2-2+ 0 x 2-3 + 1 x 2-4 = 0+.25+0+0.0625=0.3125 Fractional part (9.3125)10 Result

  17. Converting Binary to Decimal • To convert to decimal, use decimal arithmetic to form S (digit × respective power of 2). • Example: Convert (11010)2to N10:

  18. 1.3 Number-Base Conversions (3-6) Base r – to – Decimal Conversion Example: (1010.011)2= 23+ 21 + 2-2 + 2-3 =(10.375)10 (127.4)8 = 1 x 82 + 2 x 81 + 7 x 80 + 4 x 8-1 = (87.5)10 (1101)2 = 1 x 23 + 1 x 22 + 0 x 21 + 1 x 20 = (13)10

  19. Number Systems – Examples

  20. 1.2 Binary Numbers (Cont.) • The six letters (in addition to the 10 integers) in hexadecimal represent??

  21. Numbers in Different Bases Decimal Binary Octal Hexa decimal (Base 10) (Base 2) (Base 8) (Base 16) 00 00000 00 00 • Good idea to memorize! 01 00001 01 01 02 00010 02 02 03 00011 03 03 04 00100 04 04 05 00101 05 05 06 00110 06 06 07 00111 07 07 08 01000 10 08 09 01001 11 09 10 01010 12 0A 11 0101 1 13 0B 12 01100 14 0C 13 01101 15 0D 14 01110 16 0E 15 01111 17 0F 16 10000 20 10

  22. Special Powers of 2 • 210 (1024) is Kilo, denoted "K" • 220 (1,048,576) is Mega, denoted "M" • 230 (1,073, 741,824)is Giga, denoted "G"

  23. Positive Powers of 2 Exponent Value Exponent Value • Useful for Base Conversion 0 1 11 2,048 1 2 12 4,096 2 4 13 8,192 3 8 14 16,384 4 16 15 32,768 5 32 16 65,536 6 64 17 131,072 7 128 18 262,144 8 256 19 524,288 9 512 20 1,048,576 10 1024 21 2,097,152

  24. 1.2 Binary Numbers (4-6) Arithmetic Operations Follow the same rules of as for decimal numbers Addition

  25. 1.2 Binary Numbers (5-6) Arithmetic Operations Subtraction

  26. 1.2 Binary Numbers (6-6) Arithmetic Operations Multiplication

  27. Remember to review

  28. 1.3 Number-Base Conversions Converting Decimal to Binary • Method 1 • Subtract the largest power of 2 (see slide 14) that gives a positive remainder and record the power. • Repeat, subtracting from the prior remainder and recording the power, until the remainder is zero. • Place 1’s in the positions in the binary result corresponding to the powers recorded; in all other positions place 0’s. • Example: Convert 62510 toN2

  29. Positive Powers of 2 Exponent Value Exponent Value • Useful for Base Conversion 0 1 11 2,048 1 2 12 4,096 2 4 13 8,192 3 8 14 16,384 4 16 15 32,768 5 32 16 65,536 6 64 17 131,072 7 128 18 262,144 8 256 19 524,288 9 512 20 1,048,576 10 1024 21 2,097,152

  30. 1.3 Number-Base Conversions (4-6) Decimal – to – Base r Conversion Rule: Convert each part differently. • Divide number & its quotients by r. • Accumulate reminders. Integral part • Multiply number & its quotients by r. • Accumulate integers. Fractional part Integral part Fractional part Result

  31. 1.3 Number-Base Conversions (5-6) Decimal – to – Base r Conversion Example: Find the binary equivalent of the decimal number (41)10. Divide by 2 Result (101001)2

  32. 1.3 Number-Base Conversions (6-6) Decimal – to – Base r Conversion Example: Find the binary equivalent of the decimal number (0.6875)10. Result Multiply by 2 (0.1011)2

  33. 1.4 Octal and Hexadecimal Numbers (1-17)

  34. 1.4 Octal and Hexadecimal Numbers (2-17) Decimal-to-Octal Conversion Example: Find the octal equivalent of the decimal number (153.513)10. Divide by 8 Multiply by 8 Result (231.406517)8

  35. 1.4 Octal and Hexadecimal Numbers (3-17) Octal-to-DecimalConversion Example: Find the decimal equivalent ofthe octal number (137.21)8. 137= 1 x 82+ 3 x 81 + 7 x 80 = 64+24+7=95 Integral part .21 = 2 x 8-1+ 1 x 8-2 =0.265 Fractional part Result (95.265)10

  36. 1.4 Octal and Hexadecimal Numbers (4-17) Decimal-to-Hexadecimal Conversion Example: Find the hexadecimal equivalent of the decimal number (82.25)10. Divide by 16 Multiply by 16 Result (52.4)16

  37. 1.4 Octal and Hexadecimal Numbers (5-17) Hexadecimal-to-Decimal Conversion Example: Find the decimal equivalent ofthe hexadecimal number (1E0.2A)16. 1E0= 1 x 162+ 14 x 161 + 0 x 160 = 256+224+0=480 Integral part .2A = 2 x 16-1+ 10 x 16-2 =0.164 Fractional part Result (480.164)10

  38. 1.4 Octal and Hexadecimal Numbers (6-17) Binary–Octal and Octal–Binary Conversions Binary – Octal Rule: • Divide integral part into three bits starting from right integral bit. • Divide fractional part into three bits starting from left fractional bit. • Adding zero‘s if necessary.

  39. 1.4 Octal and Hexadecimal Numbers (7-17) Binary–Octal and Octal–Binary Conversions Example: Find the octal equivalent ofthe binary number (1110100.0100111)2. 001 110 100 . 010011 100 (1 6 4 . 23 4)8

  40. 1.4 Octal and Hexadecimal Numbers (8-17) Binary–Octal and Octal–Binary Conversions Octal – Binary Rule: BOTH integral and fractional parts: • Convert each digit seperately into binary of three bits

  41. 1.4 Octal and Hexadecimal Numbers (9-17) Binary–Octal and Octal–Binary Conversions Example: Find the binary equivalent ofthe octal number (374.26)8. 3 7 4 . 26 011 111 100 . 010110 (11 111 100 . 01011)2

  42. 1.4 Octal and Hexadecimal Numbers (10-17) Binary–Hex and Hex–Binary Conversions Binary – Hex Rule: • Divide integral part into four bits starting from right integral bit. • Divide fractional part into four bitsstarting from left fractional bit. • Adding zero‘s if necessary.

  43. 1.4 Octal and Hexadecimal Numbers (11-17) Binary–Hex and Hex–Binary Conversions Example: Find the hexdecimal equivalent ofthe binary number (1011001110.011011101)2. 0010 1100 1110 . 01101110 1000 (2 C E . 6E 8)16

  44. 1.4 Octal and Hexadecimal Numbers (12-17) Binary–Hex and Hex–Binary Conversions Hex – Binary Rule: BOTH integral and fractional parts: • Convert each digit seperately into binary of four bits

  45. 1.4 Octal and Hexadecimal Numbers (13-17) Binary–Hex and Hex–Binary Conversions Example: Find the binary equivalent ofthe hexadecimal number (17E.F6)16. 1 7 E . F6 0001 0111 1110 . 11110110 (1 0111 1110 . 1111011)2

  46. 1.4 Octal and Hexadecimal Numbers (14-17) Hex–Octal and Octal–Hex Conversions Hex – Octal Rule: • Convert Hex number into binary. • Convert the result binary number into octal. OR • Convert Hex number into decimal. • Convert the result decimal number into octal.

  47. 1.4 Octal and Hexadecimal Numbers (15-17) Hex–Octal and Octal–Hex Conversions Example: Find the Hex equivalent ofthe octal number (762.013)8. 7 6 2 . 01 3 Binary (0001 1111 0010 . 0000 0101 1000)2 Hex (1 F 2 . 05 8)16

  48. 1.4 Octal and Hexadecimal Numbers (16-17) Hex–Octal and Octal–Hex Conversions Octal – Hex Rule: • Convert Octal number into binary. • Convert the result binary number into Hex. OR • Convert Octal number into decimal. • Convert the result decimal number into Hex.

  49. 1.4 Octal and Hexadecimal Numbers (17-17) Hex–Octal and Octal–Hex Conversions Example: Find the octal equivalent ofthe Hex number (2F.C4)16. 2 F . C4 Binary (000 101 111. 110 001 000)2 Octal (5 7 . 61)8 (0 5 7 . 61 0)8

  50. 1.5 Complements (1-9) Complement‘s Types RadixComplement (r’s complement) Diminished radix Complement ((r-1)’s complement)

More Related