Download Document

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Index of logic articles wikipedia , lookup

Principia Mathematica wikipedia , lookup

Laws of Form wikipedia , lookup

Addition wikipedia , lookup

Elementary mathematics wikipedia , lookup

Arithmetic wikipedia , lookup

Location arithmetic wikipedia , lookup

Approximations of π wikipedia , lookup

Positional notation wikipedia , lookup

Transcript
Course contents
•
•
•
•
•
•
•
Chapter 1 - section 1.6
Chapter 2 - all sections
Chapter 4 - 4.1 – 4.7, and 4.12
Chapter 5 - 5.1-5.3, 5.6-5.7
Chapter 6 - all sections
Chapter 7 - all sections
Chapter 8 - 8.1-8.9
1
1.6 Binary numbers
• An electronic signal in logic circuits carries
one digit of information.
– Each digit is allowed to take on only two possible
values, usually denoted as 0 and 1.
– -> Information in logic circuits is represented as
combinations of 0 and 1 digits.
• Q: How to represent numbers (E.g., positive
integers) using only binary digits 0 and 1?
2
Decimal (base-10) number system
• A decimal integer is expressed by an n-tuple
comprising n decimal digits
D = dn-1dn-2 ∙ ∙ ∙ d1d0
which represents the value
V(D) = dn-1×10n-1 + dn-2×10n-2 + ∙ ∙ ∙ + d1×101 + d0×100
• This is referred to as the positional number
representation.
3
Binary (base-2) number system
• Logic circuits use the binary system whose
positional number representation is
B = bn-1bn-2 ∙ ∙ ∙ b1b0
bn-1 is the most significant bit (MSB),
b0 is the least significant bit (LSB),
Every bit bi can only have two values: 0 or 1.
4
Numbers in decimal and binary
Decimal
representation
Binary
representation
Decimal
representation
Binary
representation
00
0000
09
1001
01
0001
10
1010
02
0010
11
1011
03
0011
12
1100
04
0100
13
1101
05
0101
14
1110
06
0110
15
1111
07
0111
08
1000
5
Conversion from binary to decimal
• Compute a weighted sum of every binary digit
contained in the binary number
B = bn-1bn-2 ∙ ∙ ∙ b1b0
V(B) = bn-1×2n-1 + bn-2×2n-2 + ∙ ∙ ∙ + b1×21 + b0×20
E.g., (1101)2 = 1×23 + 1×22 + 0×21+1×20=(13)10
6
Conversion from decimal to binary
• Perform the successive division by 2 until the quotient
becomes 0.
Remainder
857 / 2 = 428
1
428 / 2 = 214
0
214 / 2 = 107
0
107 / 2 = 53
1
53 / 2 = 26
1
26 / 2 = 13
0
13 / 2 = 6
1
6/ 2 =3
0
3/ 2 =1
1
1/ 2 =0
1
LSB
MSB
7
Chapter 2
Introduction to Logic Circuits
Outline
2.1 Variables and Functions
2.2 Inversion
2.3 Truth tables
2.4 Logic gates and networks
2.5 Boolean algebra
2.6 Synthesis using AND, OR and NOT gates
2.7 NAND and NOR logic networks
2.8 Design examples
9
2.1 Variables
x=0
x=1
(a) Two states of a switch
S
x
(b) Symbol for a switch
Figure 2.1. A binary switch.
10
An application
S
Battery
x
Light
(a) Simple connection to a battery
S
Power
supply
x
Light
(b) Using a ground connection as the return path
Figure 2.2. A light controlled by a switch.
11
Functions
Power
supply
S
S
x1
x2
Light
(a) The logical AND function (series connection)
S
x1
Power
supply
S
Light
x2
(b) The logical OR function (parallel connection)
Figure 2.3. Two basic functions.
12
A series-parallel connection
S
X1
Power
supply
S
S
X3
Light
X2
L(x1, x2, x3) = (x1 + x2) x3
13
2.2 Inversion (complement, not)
R
Power
supply
x
S
Light
Figure 2.5. An inverting circuit.
14