0% found this document useful (0 votes)
2 views

Lecture-3

The document discusses the representation of signed binary numbers, including signed-magnitude, signed-1's-complement, and signed-2's-complement methods. It also covers various binary codes such as BCD and error detection using parity bits, as well as the Gray code which features single bit changes. Additionally, it includes operations of logic gates, postulates and theorems of Boolean algebra, and simplification of Boolean functions.

Uploaded by

mahmudhasansami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture-3

The document discusses the representation of signed binary numbers, including signed-magnitude, signed-1's-complement, and signed-2's-complement methods. It also covers various binary codes such as BCD and error detection using parity bits, as well as the Gray code which features single bit changes. Additionally, it includes operations of logic gates, postulates and theorems of Boolean algebra, and simplification of Boolean functions.

Uploaded by

mahmudhasansami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

07/01/2024

Signed Binary Numbers


Positive integers (including zero) can be represented as unsigned numbers. However, to
represent negative integers, we need a notation for negative values. In ordinary arithmetic, a negative number is
indicated by a minus sign and a positive number by a plus- sign. Because of hardware limitations, computers must
represent everything with binary digits. It is customary to represent the sign with a bit placed in the leftmost
position of the number. The convention is to make the sign bit 0 for positive and 1 for negative.
If the binary number is signed, then the leftmost bit represents the sign and the rest of the bits represent the
number. If the binary number is assumed to be unsigned, then the leftmost bit is the most significant bit of the
number. For example, the string of bits 01001 can be considered as 9 (unsigned binary) or as +9 (signed binary)
because the leftmost bit is 0. The string of bits 11001 represents the binary equivalent of
25 when considered as an unsigned number and the binary equivalent of -9 when considered as a signed number.
This is because the 1 that is in the leftmost position designates a negative and the other four bits represent binary
9. Although there is only one way to represent +9, there are three different ways to represent -9 with eight bits:

Signed-magnitude representation: 10001001


Signed-1′s-complement representation: 11110110
Signed-2′s-complement representation: 11110111
07/01/2024

Binary codes
BCD
Decimal
8421 Excess-3 84 -2 -1 2421
digit
23222120
Weighted code Unweighted code Weighted code Weighted code

0 0000 0011 0000 0000


1 0001 0100 0111 0001
2 0010 0101 0110 0010
3 0011 0110 0101 0011
4 0100 0111 0100 0100
5 0101 1000 1011 1011
6 0110 1001 1010 1100
7 0111 1010 1001 1101
8 1000 1011 1000 1110
9 1001 1100 1111 1111

Error detection codes:


Many systems use a parity bit as a means for bit error detection. A parity bit is attached
to a group of bits to make the total number of 1s in a group always even or always odd.
An even parity bit makes the total number of 1s even, and an odd parity bit makes the total Even parity Odd parity
odd. A given system operates with even or odd parity, but not both. For instance, if a
system operates with even parity, a check is made on each group of bits received to make Message P Message P
sure the total number of 1s in that group is even. If there is an odd number of 1s, an error 0000 0 0000 1
has occurred. A parity bit provides for the detection of a single bit error (or any odd 0001 1 0001 0
number of errors, which is very unlikely) but cannot check for two errors in one 0010 1 0010 0
group. 0011 0 0011 1
0100 1 0100 0
0101 0 0101 1
0110 0 0110 1
0111 1 0111 0
Number of bit transfer= 5 1000 1 1000 0
1001 0 1001 1
Transmit Receive Check 1010 0 1010 1
Even Even OK 1011 1 1011 0
1100 0 1100 1
Even Odd Error 1101 1 1101 0
Odd Odd OK 1110 1 1110 0
Odd Even Error 1111 0 1111 1
07/01/2024

Gray code:
The Gray code is unweighted and is not an arithmetic code; that is, there are no
specific weights assigned to the bit positions. The important feature of the Gray
code is that it exhibits only a single bit change from one code word to the next
in sequence.

Binary Gray code


Decimal
0111 to 1000 0100 to 1100
7 to 8
Four bit changes Single bit changes here

Switching circuit and logic gates


OR Operation
AND Operation
For two input(x & y) OR gate, The output z = x+y
For two input(x & y) AND gate, The output z= xy

x y z=x.y x y z=x+y
0 0 0 0 0 0
0 1 0 0 1 1
1 0 0 1 0 1
1 1 1 1 1 1
07/01/2024

Switching circuit and logic gates


NOT Operation NAND Operation
For input ‘x’ the output of NOT gate z= x′ For two input (x & y) NAND gate, The output z= (x . y)′

x y z=(x.y)′
x z=x′
0 0 1
0 1
0 1 1
1 0
1 0 1
1 1 0

Switching circuit and logic gates


XOR & XNOR Operation
NOR Operation
For two input(x & y) XOR gate, The output z= (x ⊕ y)
For two input(x & y) NOR gate, The output z= (x+y)′
x y z=x⊕y z=(x⊕y)′
x y z=(x+y)′
0 0 0 1
0 0 1
0 1 1 0
0 1 0
1 0 1 0
1 0 0
1 1 0 1
1 1 0
z=x⊕ y
z = x′y+xy′
=x⊕ y

z = (x ⊕ y)′
07/01/2024

Timing diagram of logic gates

Postulates and Theorems of


Boolean Algebra
Postulate 2 a x+0=x b x.1=x

Postulate 5 a x+x′=1 b x.x′=0

Theorem 1 a x+x=x b x.x=x

Theorem 2 a x+1=1 b x.0=0

Theorem 3 Involution a (x′)′=x

Postulate 3, commutative a x+y=y+x b xy=yx

Theorem 4, associative a x+(y+z)=(x+y)+z b x(yz)=(xy)z

Postulate 4, distributive a x (y+z)=xy+xz b x + yz = (x + y)(x + z)

Theorem 5, DeMorgan a (x + y)′= x′ y′ b (xy)′ = x′ + y′

Theorem 6, absorption a x + xy = x b x(x + y) = x


07/01/2024

x.x = x x + xy = x x+x=x
Statement Statement Statement
x.x = xx + 0 x + xy = x . 1 + xy x + x = (x + x) . 1
= xx + xx′ = x(1 + y) = (x +x)(x + x′)
= x(x + x′) =x.1 = x . x + x . x′
= x .1 = x = x+0
=x = x

x+1=1
Statement x(x+y)=x x y x+y x(x+y)
x + 1 = (x + 1) . 1 L.H.S
= (x +1)(x + x′) x(x+y) 0 0 0 0
= x . x + 1 . x′ = x . x + xy
0 1 1 0
= x + x′ = x + xy
= 1 = x(1 + y) 1 0 1 1
=x.1
=x 1 1 1 1
07/01/2024

Simplify the following Boolean function to a minimum number of literals


1. x(x′ + y) = xx′+xy = 0 + xy = xy
2. x + x′ y = (x + x′ )(x + y) = 1 . (x + y) = x + y
3. (x + y)(x + y′) = xx + xy + xy′ + yy′ = x (1 + y + y′) = x
4. xy + x′z + yz = xy + x′z +yz (x + x′ )
= xy + x′z + xyz +x′yz
= xy(1 +z) + x′z(1 + y)
= xy + x′z.
5. (x + y)(x′ + z)(y + z) = (x + y)(x′ + z), by duality from function 4

DE Morgan's theorem

x y z=(xy)′ z=x′+y′
(xy)′ = x′ + y′ 0 0 1 1
0 1 1 1
≅ 1 0 1 1
1 1 0 0

≅ x y z=(x+y)′ z=x′y′
0 0 1 1
(x + y)′= x′ y′ 0 1 0 0
1 0 0 0
1 1 0 0

You might also like