طراحی مدارهای منطقی
DESCRIPTION
طراحی مدارهای منطقی. دانشگاه آزاد اسلامی واحد پرند. نیمسال دوم 92-93. طراحی مدارهای منطقی. دانشگاه آزاد اسلامی واحد پرند. سیستم اعداد. Why Binary Numbers?. The switching devices used in digital systems are generally two-state devices: - PowerPoint PPT PresentationTRANSCRIPT
طراحی مدارهای منطقی
93-92نیمسال دوم
دانشگاه آزاد اسالمی واحد پرند
دانشگاه آزاد اسالمی واحد پرندطراحی مدارهای منطقی
سیستم اعداد
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
4
Number Systems
Base (مبنا)
مبنايr[ 0: ارقام محدود به ,r-1]
10(379)دسيمال:•
2(01011101)باينري:•
8(372)اکتال:•
16(23D9F)هگزادسيمال:•
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
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
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
8
2’s Powers
9
Number Systems
Conversions
دسيمال هر مبناي r
هر مبنایr دسيمال
دسيمال باينري
اکتالباينري و برعکس
هگزادسيمالباينري و برعکس
10
Number Systems
Conversions هر مبنا به دسیمال
11
Number Systems
Conversions دسیمال به هر مبنا تقسیمات متوالیدر بخش صحیح
خواندن باقیمانده ها از آخر به اول : معادل عدد از چپ بهراست
ضرب متوالی در بخش اعشاری خواندن بخش صحیح از اول به آخر : معادل اعداد بعد از ممیز
از چپ به راست
12
Number Systems
Conversions دسیمال به هر مبنا
13
Number Systems
Conversions )دسیمال به باینری )روش متفاوت
ورودی: عدد دسیمالN
در 2بزرگترين توان N 2)حفظ جدول توان را پیدا کن اینجا کاربرد دارد!(
را از 2 عدد توان Nکم کن در بیت معادل رقم توان قرار بده1يک عدد •
2 را با عدد به دست آمده از مرحله 1مرحلة تکرار کن
توقف الگوریم: صفر شدن اختالف
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
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
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
17
Decimal, Binary, Octal, Hexadecimal
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
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
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
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
22
Signed Binary numbers n=4
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)
24
Addition of 2’s complement numbers
25
Addition of 2’s complement numbers
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)
27
Possible Binary Codes for Decimal Digits
28
Another Useful Coding
ASCII American Standard Code for Information Interchange
7-bit code Possible 27 = 128 characters can be coded