Presentation is loading. Please wait.

Presentation is loading. Please wait.

طراحی مدارهای منطقی نیمسال دوم 92-93 دانشگاه آزاد اسلامی واحد پرند.

Similar presentations


Presentation on theme: "طراحی مدارهای منطقی نیمسال دوم 92-93 دانشگاه آزاد اسلامی واحد پرند."— Presentation transcript:

1 طراحی مدارهای منطقی نیمسال دوم 92-93 دانشگاه آزاد اسلامی واحد پرند

2 طراحی مدارهای منطقی دانشگاه آزاد اسلامی واحد پرند سیستم اعداد

3 Why Binary Numbers?  The switching devices used in digital systems are generally two-state devices:  The output can assume only two different discrete values Transistors, Diodes …  Because the outputs of most switching devices assume only two different values, it is natural to use binary numbers internally in digital systems  For this reason:  Binary numbers and number systems 3

4 Number Systems  Base (مبنا)  مبناي r: ارقام محدود به [0, r-1] دسيمال:(379) 10 باينري:(01011101) 2 اکتال:(372) 8 هگزادسيمال:(23D9F) 16 4

5 Number Systems  General N = (a n-1 …a 2 a 1 a 0.a -1 a -2 …a -m ) r = a n-1  r n-1 + a n-2  r n-2 +… + a 1  r + a 0 + a -1  r -1 + a -2  r -2 +… + a -m  r -m 5

6 Number Systems  General N = (a n-1 …a 2 a 1 a 0.a -1 a -2 …a -m ) r = a n-1  r n-1 + a n-2  r n-2 +… + a 1  r + a 0 + a -1  r -1 + a -2  r -2 +… + a -m  r -m 6

7 Number Systems  Binary Numbers  Computers: Strings of bits  0,1  (101101.10) 2 = 1  2 5 + 0  2 4 + 1  2 3 + 1  2 2 + 0  2 1 + 1  2 0 + 1  2 -1 + 0  2 -2 32 16 8 4 2 1.5.25.125.0625 ( 1 1 0 1 0 1. 1 0 1 1 )= ( 53.6785 ) BD 7

8 2’s Powers 8

9 Number Systems  Conversions  دسيمال  هر مبناي r  هر مبنای r  دسيمال  دسيمال  باينري  اکتال  باينري و برعکس  هگزادسيمال  باينري و برعکس 9

10 Number Systems  Conversions  هر مبنا به دسیمال 10

11 Number Systems  Conversions  دسیمال به هر مبنا  تقسیمات متوالی  در بخش صحیح  خواندن باقیمانده ها از آخر به اول : معادل عدد از چپ به راست  ضرب متوالی  در بخش اعشاری  خواندن بخش صحیح از اول به آخر : معادل اعداد بعد از ممیز از چپ به راست 11

12 Number Systems  Conversions  دسیمال به هر مبنا 12

13 Number Systems  Conversions  دسیمال به باینری (روش متفاوت)  ورودی: عدد دسیمال N  بزرگترين توان 2 در N را پیدا کن (حفظ جدول توان 2 اینجا کاربرد دارد!)  عدد توان 2 را از N کم کن يک عدد 1 در بیت معادل رقم توان قرار بده  مرحلة 1 را با عدد به دست آمده از مرحله 2 تکرار کن  توقف الگوریم: صفر شدن اختلاف 13

14 Number Systems  Conversions  دسیمال به باینری (روش متفاوت) N = (717) 10 717 – 512 = 205 = N 1 512 = 2 9 205 –128 = 77 = N 2 128 = 2 7 77 – 64 = 13 = N 3 64 = 2 6 13 – 8 = 5 = N 4 8 = 2 3 5 – 4 = 1 = N 5 4 = 2 2 1 – 1 = 0 = N 6 1 = 2 0 (717) 10 = 2 9 + 2 7 + 2 6 + 2 3 + 2 2 + 2 0 = ( 1 0 1 1 0 0 1 1 0 1) 2 14

15 Number Systems  Conversions  اکتال به باینری و برعکس هر سه بیت باینری یک بیت اکتال (011 010 101 000. 111 101 011 100) 2 ( 3 2 5 0. 7 5 3 4 ) 8 (11010101000.1111010111) 2 15

16 Number Systems  Conversions  هگزادسیمال به باینری و برعکس هر 4 بیت باینری یک بیت هگزادسیمال ( 6 A8. F 5 C ) 16 ( 0110 1010 1000. 1111 0101 1100 ) 2 (110 1010 1000. 1111 0101 11 ) 2 16

17 Decimal, Binary, Octal, Hexadecimal 17

18 Binary Arithmetic  Arithmetic operations in digital systems are usually done in binary:  Design of logic circuits is simpler in binary  Addition table for binary 18

19 Binary Arithmetic  Arithmetic operations in digital systems are usually done in binary:  Design of logic circuits is simpler in binary  Subtraction table for binary 19

20 Binary Arithmetic  Arithmetic operations in digital systems are usually done in binary:  Design of logic circuits is simpler in binary  Multiplication table for binary 20

21 Representation of Negative Numbers  Sign and magnitude  First bit from left is sign bit 2 n-1 -1 : 2 n-1 -1  One’s Complement of N 2 n-1 -1 : 2 n-1 -1  Two’s Complement of N 2 n-1 : 2 n-1 -1 3  0011 -3  1011 3  0011 -3  1100 3  0011 -3  1101 21

22 Signed Binary numbers n=4 22

23 مفهوم Overflow  When the word length is n bits:  We say that an overflow has occurred if the correct representation of the sum (including sign) requires more than n bits Overflow when  sign(A) = sign(B) ≠ sign (result) 23

24 Addition of 2’s complement numbers 24

25 Addition of 2’s complement numbers 25

26 Binary Codes  Large computers work  Internally: binary numbers  The input output equipment: decimal numbers  Because most logic circuits only accept two-valued signals, the decimal numbers must be coded in terms of binary signals  Simplest Binary Coding  BCD (Binary Coded Decimal) 26

27 Possible Binary Codes for Decimal Digits 27

28 Another Useful Coding  ASCII  American Standard Code for Information Interchange  7-bit code  Possible 2 7 = 128 characters can be coded 28


Download ppt "طراحی مدارهای منطقی نیمسال دوم 92-93 دانشگاه آزاد اسلامی واحد پرند."

Similar presentations


Ads by Google