University Lecture 1

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Digital and Analog

Electronics
EET2301
Imanthi Subasinghe
isubasin@tec.rjt.ac.lk
Contents of Course Unit.

1. Introduction to digital logic.


2. Boolean algebra and logic gates.
3. Gate level optimization.
4. Combinational logic circuits.
5. Sequential logic circuits and memory elements.
References

● M. Morris Mano, and Michael D. Ciletti, Digital Design with an Introduction to


Verilog HDL, VHDL, and System Verilog, sixth edition, Pearson.

● Wayne Wolf, FPGA-Based System Design, Prentice Hall.


Introduction to Digital Logic
• Digital systems.
• Number systems.
General way of representation

Number base conversion.

Octal and hexadecimal numbers.


Introduction to Digital Logic
• Complement of a number.
• Signed binary number.
• Binary codes
• Binary logic
• Field Effect Transistors
Digital Systems
• Present age of technology is referred to as digital age.
• Digital systems are used in
• communication
• business transaction
• traffic control
• spacecraft guidance
• medical treatment
• weather monitoring and etc.
Other Digital Systems
• Special purpose digital computers .
• Used to represent and manipulate discrete elements of
information.
Digital Systems
• Discrete elements of information can be represented by group of
binary digits called binary codes.
• Either can be emerged from
– a processed data or
– quantized from continuous signals.
• Example
A general purpose digital computer that contains
– A memory unit
– A central processing unit
– I/O units.
Digital Systems
Most of commercial devices are made of digital circuits.
• They are programmable.
• Same type of hardware can be used for different applications.
• Advances in Integrated Circuit technology.
• Performs at very high speed.
100 Millions of operations per second.
• Can operate with high reliability .
Error correction codes.
Digital Systems
Most of commercial devices are made of digital circuits.
• They are programmable.
• Same type of hardware can be used for different applications.
• Advances in Integrated Circuit technology.
• Performs at very high speed.
100 Millions of operations per second.
• Can operate with high reliability .
Error correction codes.
Number Systems
• We can use different number systems (with different bases or
radixes) such as,
• 7392
• 26.75
• 1101012
• B65F16
• 673.1248
• Most Significant Bit (MSB) and Least Significant Bit (LSB) of a
number.
Arithmetic Operations of Number
System.
Follows the same rules as decimal numbers.
• Example: If r =2,
Subtraction
Minuend 101101
Subtrahend 100111
Addition
Difference
Augend 101101
Addend 100111
Sum
Radix Complement
• 2’s complement of a number.
- Obtained by leaving all least significant 0’s and the first 1
unchanged and replacing 1’s with 0’s and 0’s with 1’s in all
other higher significant digits.
- 2’s complement of 0110111 is 1001001.
Signed Binary Numbers
Signed & Magnitude Conversion.
• Need to represent signed and unsigned numbers by a string of
bits in computers.
• If it is a signed number, then the leftmost bit may represent the
sign.
Signed Binary Numbers
Signed & Magnitude Conversion.
• If it is an unsigned number, then the left most bit is the MSB of
the number.
• Example
11001 represents,
– 25, for unsigned representation.
– -9, for signed representation.
Signed Binary Numbers (cont’d)
Signed & Complement System
A different system called Signed & Complement System is also
widely used.
• The signed & complement system uses complement of a
number to negates it.
- Either 1’s complement or 2’s complement can be used.
- 2’s complement is most commonly used.
Example
• +9 is represented as,
00001001 (signed & magnitude)
• -9 is represented as,
• 10001001 (signed-magnitude)
• 11110110 (signed-1’s compliment)
• 11110111 (signed-2’s compliment)
Arithmetic Addition
1. If there are any negative numbers (addend or augend) then convert
them into 2’s complement.
2. Add the two numbers, including sign-bit position.
3. Discard carry-out of the sign-bit position (if any).

Example

Negative results are already in 2’s complement.


Arithmetic Subtraction
1. If there any negative number (minuend, or subtrahend) then
convert them into 2’s complement.
2. Take 2’s complement of subtrahend and add with minuend.
3. Discard carry out of signed bit position (if any).
Example
Consider (-6) – (-13) = +7
– 2’s Complement of the negative numbers are (1111 1010) ,
and (1111 0011).
– 2’s complement of subtrahend (-13) is 0000 1101.
– Add to the minuend with 2’s complement of the subtrahend.
1111 1010 + 0000 1101 = 1 0000 0111
– Discard the carry out position.
Result is 00000111 (+7).
Binary Codes.
• Binary codes are used to represent a set of discrete elements
that is distinct among the set.
• An n-bit binary code has 2n distinct combinations of 1’s and 0’s.
Example: - Four- bit binary code is used to represent a set of
16 elements .
• Also a binary code may have some unassigned bit combinations.
Binary Coded Decimal
• A binary code represents only 10 elements must contain at least
4-bits,
Six out of the 16 possible combinations remain unassigned.
• The code which uses the straight binary assignment is called
binary-coded decimal (BCD).
• BCD: Each group of 4 bits represents one decimal digit.
• Example:- 18510 = 0001 1000 0101BCD = 101110012
• The binary combinations (1010 to 1111 ) are not used and
having no meaning in BCD.
Example
Consider the addition of 184 + 576.
Other Binary Codes
Gray Code
• Mostly used in ADC systems.
• A most convenient binary code.
• When going from one number to the next, only one bit in the code changes.
• Reduce error or ambiguity in hardware.
• Application,
Used to represent angular position of a mechanical-shaft.
Example
Binary Logic.
• Contains variables, which take two discrete values (1 or 0).
• Referred to as Boolean algebra.
• Binary logic.
– Consists of binary variables and a set of logical operations.
– There are three basic logical operations: AND, OR and NOT.
– Each operation produces a binary result.
Logic Gates
• Logic gates are electronic circuits.
• Operate with one or more input signals and produce an output
signal.
• The input terminal of digital circuits accepts binary signals within
an allowable range.
• Output signal falls within a specified range.
• The intermediate region is crossed only during a state transition.
State Transition
Example

Two input AND gate Two input OR gate NOT gate

Three input AND gate Four input OR gate

You might also like