طراحی مدارهای منطقی

28
ی ق ط ن مرهای ی مدا ح را ط سال دوم م ی ن92 - 93 د رن# پ ی واحد م لا س اد ا ه ا*را گ- ش ن دا

Upload: rudolf

Post on 04-Jan-2016

42 views

Category:

Documents


2 download

DESCRIPTION

طراحی مدارهای منطقی. دانشگاه آزاد اسلامی واحد پرند. نیمسال دوم 92-93. طراحی مدارهای منطقی. دانشگاه آزاد اسلامی واحد پرند. سیستم اعداد. Why Binary Numbers?. The switching devices used in digital systems are generally two-state devices: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: طراحی مدارهای منطقی

طراحی مدارهای منطقی

93-92نیمسال دوم

دانشگاه آزاد اسالمی واحد پرند

Page 2: طراحی مدارهای منطقی

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

سیستم اعداد

Page 3: طراحی مدارهای منطقی

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

Page 4: طراحی مدارهای منطقی

4

Number Systems

Base (مبنا)

مبنايr[ 0: ارقام محدود به ,r-1]

10(379)دسيمال:•

2(01011101)باينري:•

8(372)اکتال:•

16(23D9F)هگزادسيمال:•

Page 5: طراحی مدارهای منطقی

5

Number Systems

General

N = (an-1…a2a1a0.a-1a-2…a-m)r =

an-1 r n-1 + an-2r n-2 +… + a1r + a0 +

a-1 r -1 + a-2r -2 +… + a-m r -m

Page 6: طراحی مدارهای منطقی

6

Number Systems

General

N = (an-1…a2a1a0.a-1a-2…a-m)r =

an-1 r n-1 + an-2r n-2 +… + a1r + a0 +

a-1 r -1 + a-2r -2 +… + a-m r -m

Page 7: طراحی مدارهای منطقی

7

Number Systems

Binary Numbers Computers: Strings of bits 0,1

(101101.10)2 = 125 + 024 + 123 + 122 + 021 + 120 + 12-1 + 02-2

32 16 8 4 2 1 .5 .25 .125 .0625( 1 1 0 1 0 1 . 1 0 1 1 ) = ( 53.6785 )

B D

Page 8: طراحی مدارهای منطقی

8

2’s Powers

Page 9: طراحی مدارهای منطقی

9

Number Systems

Conversions

دسيمال هر مبناي r

هر مبنایr دسيمال

دسيمال باينري

اکتالباينري و برعکس

هگزادسيمالباينري و برعکس

Page 10: طراحی مدارهای منطقی

10

Number Systems

Conversions هر مبنا به دسیمال

Page 11: طراحی مدارهای منطقی

11

Number Systems

Conversions دسیمال به هر مبنا تقسیمات متوالیدر بخش صحیح

خواندن باقیمانده ها از آخر به اول : معادل عدد از چپ بهراست

ضرب متوالی در بخش اعشاری خواندن بخش صحیح از اول به آخر : معادل اعداد بعد از ممیز

از چپ به راست

Page 12: طراحی مدارهای منطقی

12

Number Systems

Conversions دسیمال به هر مبنا

Page 13: طراحی مدارهای منطقی

13

Number Systems

Conversions )دسیمال به باینری )روش متفاوت

ورودی: عدد دسیمالN

در 2بزرگترين توان N 2)حفظ جدول توان را پیدا کن اینجا کاربرد دارد!(

را از 2 عدد توان Nکم کن در بیت معادل رقم توان قرار بده1يک عدد •

2 را با عدد به دست آمده از مرحله 1مرحلة تکرار کن

توقف الگوریم: صفر شدن اختالف

Page 14: طراحی مدارهای منطقی

14

Number Systems

Conversions )دسیمال به باینری )روش متفاوتN = (717)10

717 – 512 = 205 = N1 512 = 29

205 –128 = 77 = N2 128 = 27

77 – 64 = 13 = N3 64 = 26

13 – 8 = 5 = N4 8 = 23

5 – 4 = 1 = N5 4 = 22

1 – 1 = 0 = N6 1 = 20

(717)10 = 29 + 27 + 26 + 23 + 22 + 20 = ( 1 0 1 1 0 0 1 1 0 1)2

Page 15: طراحی مدارهای منطقی

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

Page 16: طراحی مدارهای منطقی

16

Number Systems

Conversions هگزادسیمال به باینری و برعکس

بیت باینری یک بیت هگزادسیمال4هر

) 6 A 8 . F 5 C (16

) 0110 1010 1000 . 1111 0101 1100 (2

)110 1010 1000 . 1111 0101 11 (2

Page 17: طراحی مدارهای منطقی

17

Decimal, Binary, Octal, Hexadecimal

Page 18: طراحی مدارهای منطقی

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

Page 19: طراحی مدارهای منطقی

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

Page 20: طراحی مدارهای منطقی

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

Page 21: طراحی مدارهای منطقی

21

Representation of Negative Numbers

Sign and magnitude First bit from left is sign bit

• 2n-1 -1 : 2n-1 -1

One’s Complement of N• 2n-1 -1 : 2n-1 -1

Two’s Complement of N• 2n-1 : 2n-1 -1

3 0011-3 1011

3 0011-3 1100

3 0011-3 1101

Page 22: طراحی مدارهای منطقی

22

Signed Binary numbers n=4

Page 23: طراحی مدارهای منطقی

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)

Page 24: طراحی مدارهای منطقی

24

Addition of 2’s complement numbers

Page 25: طراحی مدارهای منطقی

25

Addition of 2’s complement numbers

Page 26: طراحی مدارهای منطقی

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)

Page 27: طراحی مدارهای منطقی

27

Possible Binary Codes for Decimal Digits

Page 28: طراحی مدارهای منطقی

28

Another Useful Coding

ASCII American Standard Code for Information Interchange

7-bit code Possible 27 = 128 characters can be coded