JNTUA Digital Electronics & Microprocessors Lab Manual R20
JNTUA Digital Electronics & Microprocessors Lab Manual R20
me/jntua
Name:_____________________________________________
H.T.No:____________________________________________
Year/Semester:______________________________________
PEO 1: To prepare the graduates to be able to plan, analyze and provide innovative ideas to
investigate complex engineering problems of industry in the field of Electronics and
Communication Engineering using contemporary design and simulation tools.
PEO-2: To provide students with solid fundamentals in core and multidisciplinary domain for
successful implementation of engineering products and also to pursue higher studies.
PEO-3: To inculcate learners with professional and ethical attitude, effective communication
skills, teamwork skills, and an ability to relate engineering issues to broader social context at
work place
Programme Outcomes(Pos)
CO1 Design any Logic circuit using basic concepts of Boolean Algebra.
CO2 Design any Logic circuit using basic concepts of PLDs.
PART A:
LIST OF EXPERIMENTS:
DIGITAL ELECTRONICS:
1. Verification of Truth Table for AND, OR, NOT, NAND, NOR and EX-OR gates.
2. Realisation of NOT, AND, OR, EX-OR gates with only NAND and only NOR gates.
3. Karnaugh map Reduction and Logic Circuit Implementation.
4. Verification of DeMorgan’s Laws.
5. Implementation of Half-Adder and Half-Subtractor.
6. Implementation of Full-Adder and Full-Subtractor.
7. Four Bit Binary Adder
8. Four Bit Binary Subtractor using 1’s and 2’s Complement.
MICROPROCESSORS (8086 Assembly Language Programming)
1. 8 Bit Addition and Subtraction.
2. 16 Bit Addition.
3. BCD Addition.
4. BCD Subtraction.
5. 8 Bit Multiplication.
6. 8 Bit Division.
7. Searching for an Element in an Array.
8. Sorting in Ascending and Descending Orders.
9. Finding Largest and Smallest Elements from an Array.
10. Block Move
HARDWARE EXPERIMENTS
1. Verification of Truth Table for AND, OR, NOT, NAND, NOR and EX-OR gates.
2. Realisation of NOT, AND, OR, EX-OR gates with only NAND and only NOR gates.
3. Verification of DeMorgan’s Laws.
4. Implementation of Half-Adder and Half-Subtractor.
5. Implementation of Full-Adder and Full-Subtractor.
6. Four Bit Binary Adder
ADVANCED EXPERIMENTS:
CONTENTS
8 16 Bit Addition.
9 8 Bit Multiplication.
10 8 Bit Division.
ADVANCED EXPERIMENTS
1 4-Bit Binary To Gray Code Converter
LCM for the given data
2
DO’s
SCHEME OF EVALUATION
Marks Awarded
Recor Total
S.No Program Date Obs. Viva Attd.
d 30(M)
(10M) (5M) (5M)
(10M)
Verification of Truth
Table for AND, OR,
1
NOT, NAND, NOR and
EX-OR gates.
Realisation of NOT,
AND, OR, EX-OR gates
2
with only NAND and
only NOR gates.
Verification of
3
DeMorgan’s Laws.
Implementation of Half-
4 Adder and Half-
Subtractor.
Implementation of Full-
5 Adder and Full-
Subtractor.
6 Four Bit Binary Adder
9 8 Bit Multiplication.
10 8 Bit Division.
Sorting in Ascending and
11
Descending Orders.
Finding Largest and
12 Smallest Elements from
an Array.
ADVANCED EXPERIMENTS
4-Bit Binary To Gray
1
Code Converter
2 LCM for the given data
INTRODUCTION
Digital IC Trainer KIT Operation (Model No: 9002):
Specification :Digital IC Trainer KIT Operation (Model No: 9002) Specification : Digital IC Trainer Kit
Model No. 9002 is available with 10 nos. of TTL compatible logic level inputs, TTL logic selectable by a
toggle switch, Logic HIGH and logic LOW are displayed by LED, 10 nos of Logic Output indictors, Four
crystal generated clock output of 1KHz, 100Hz, 10Hz and 1Hz. Facility for single pulse generation by a
push button switch, Logic probe to check logic LOW, logic HIGH and pulse, Four seven segment
displays with BCD inputs, Sockets onboard to fix the IC`s : 16pin-4nos. Built-in Power supply : 5V,
1Amp, +12V, 250mA
How to use the IC Trainer Kit? Connect the 230 volts AC power supply and switch
‘ON’ the Toggle switch ‘ON’ the left side of the Top Panel, LED will glow. Digital IC Trainer Kit is ready for
use. Select the TTL IC to be used for the experiment. Insert the IC properly in the breadboard/ZIF socket (lock
the ZIF by moving lever upwards), Know the biasing voltage required for different families of IC’s and connect
power supply voltage and ground terminals to the respective pins of the IC. Inputs such as logic clock, of
different frequency, monopulse, logic levels, BCD inputs, can be selected from the patch panel.
Outputs such as LED indicator, seven segment digital display can be selected depending
upon the requirement. Connect the pin connection of IC using wires as per the logic diagram, after verifying
connection switch on the supply of IC Trainer Kit and verify the operation the circuit with the help of truth
table.
the breadboard, wire up the power and ground connections as described in the next section and next wire the
logic elements according to the circuit connections that you obtained from the design process. Before you insert
a chip into the breadboard, make sure it is properly oriented (see Figures), and that when you press it down the
pins of the chip actually enter the holes and do not bend underneath the chip package. When wiring, be careful
to hit the right hole needed in the connection, because this is one of the most common mistakes found to cause
an error in your projects.
The chips or packages that will be used to build the experiments belong to the TTL logic family, and they
are referred as the 74LSXX family, where the XX is a number that indicates the specific kind of gate or
function. The main characteristics for some typical logic gates packages are shown in Figures
TTL Packages Description:
Logic Gates
Digital logic devices are the circuits that electronically perform logic operations on binary variables.
binary information is represented by high and low voltage levels, which the device processes electronically. The
devices that perform the simplest of the logic operations (such as AND, OR, NAND,etc.) are called gates. For
example, an AND gate electronically computes the AND of the voltage encoded binary signals appearing at its
inputs and presents the voltage encoded result at its output.
The digital logic circuits used in this laboratory are contained in integrated circuit (IC) packages, with
generally 14 or 16 pins for electrical connections. Each IC is labeled (usually with an 74LSxx number) to identify
the logic it performs. The logic diagrams and pin connections for these IC’s are described in the TTL Data Book by
Texas Instruments1.
The transistor-transistor logic(TTL) IC’s used in this laboratory require a 5.0 volt power supply for
operation. TTL inputs require a voltage greater than 2 volts to represent a binary 1 and a voltage less than 0.8 volts
to represent a binary 0.
Pin numbering is standard on IC’s. Figure 1-1 illustrates the pin numbering for a 14-pin dual in-line
package (DIP). With the IC oriented as shown, the numbering starts at the top left and proceeds counterclockwise
around the chip:
To construct circuits with IC’s, a circuit board that allows easy connections to IC pins should be used. The
circuit board contains rows of solder less tie points, a 5-volt power supply, a common circuit point (ground), toggle
switches for input, and LEDs (light emitting diodes) for output.
NOT GATE
OR GATE
AND GATE
NAND GATE
EXP. NO : 01 DATE:
LOGIC GATES
Aim: Verification of Truth Table for AND, OR, NOT, NAND, NOR and EX-OR gates.
Components Required:
Sl. No Name of the Gate IC number Qty
1 AND gate 7408 2
2 OR gate 7432 2
3 Not gate 7404 2
4 EXOR gate 7486 2
5 NAND gate 7400 2
6 NOR gate 7402 2
7 EX-NOR gate 4077 1
8 Patch chords few
9 Trainer Kit
THEORY:
The basic logic gates are the building blocks of more complex logic circuits. These logic gates
perform the basic Boolean functions, such as AND, OR, NAND, NOR, Inversion, Exclusive-OR,
Exclusive-NOR. Fig. below shows the circuit symbol, Boolean function, and truth. It is seen from
the Fig that each gate has one or two binary inputs, A and B, and one binary output, C. The small
circle on the output of the circuit symbols designates the logic complement. The AND, OR, NAND,
and NOR gates can be extended to have more than two inputs. A gate can be extended to have
multiple inputs if the binary operation it represents is commutative and associative.
NOR GATE
XOR GATE
EX-NOR GATE
PROCEDURE:
1.Connect the IC in AC bread board .
3.Set up the circuit one by one and verify their truth table.
4.Observe the output corresponding to input combinations and enter it in truth table.
RESULT:
VIVA QUESTIONS:
3. Give the truth table for EX-NOR and realize using NAND gates?
AIM: Realization of NOT, AND, OR, EX-OR gates with only NAND and only NOR gates.
Components Required:
Sl. No Name of the gate IC number Qty
1 AND gate 7408 2
2 OR gate 7432 2
3 NOT gate 7404 2
4 EX-ORgate 7486 2
5 NAND gate 7400 2
6 NOR gate 7402 2
7 EX-NOR gate 4077 1
8 Patch chords few
9 Trainer Kit
THEORY:
The basic logic gates are the building blocks of more complex logic circuits. These logic gates
perform the basic Boolean functions, such as AND, OR, NAND, NOR, Inversion, Exclusive-OR,
Exclusive-NOR. Fig. below shows the circuit symbol, Boolean function, and truth. It is seen from the Fig
that each gate has one or two binary inputs, A and B, and one binary output, C. The small circle on the
output of the circuit symbols designates the logic complement. The AND, OR, NAND, and NOR gates
can be extended to have more than two inputs. A gate can be extended to have multiple inputs if the
binary operation it represents is commutative and associative.
PROCEDURE:
1.Connect the IC in AC bread board .
3.Set up the circuit one by one and verify their truth table.
4.Observe the output corresponding to input combinations and enter it in truth table.
RESULT:
VIVA QUESTIONS:
a)
TRUTH TABLE:
A B
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
CIRCUIT DIAGRAM:
b)
TRUTH TABLE:
A B
0 0 1 1
0 1 0 0
1 0 0 0
1 1 0 0
CIRCUIT DIAGRAM:
PROCEDURE:
1.Connect the IC in AC bread board .
3.Set up the circuit one by one and verify their truth table.
4.Observe the output corresponding to input combinations and enter it in truth table.
RESULT:
VIVA QUESTIONS:
Timing Diagram:
EXP. NO : 04 DATE:
Components Required:
Sl. No Name of the Component IC number Qty
1 AND gate 7408 1
2 OR gate 7432 1
3 Not gate 7404 1
4 EXOR gate 7486 3
5 NAND gate 7400 3
6 NOR gate 7402 3
7 Patch chords Few
8 Trainer Kit
THEORY:
Half-Adder: A combinational logic circuit that performs the addition of two data bits,
A and B, is called a half-adder. Addition will result in two output bits; one of which is
the sum bit, S, and the other is the carry bit, C. The Boolean functions describing the
half-adder are:
S =A B C=AB
PROCEDURE:
1. Obtain the Boolean Expressions for half adder and half subtractor (sum & Carry) by
writing the truth table and simplifying with the help of K-map.
3. Apply different combinations of inputs according to the truth table and verify the
outputs.
0 0 0 0 0
1 0 1 1 1
2 1 0 1 0
3 1 1 0 0
Timing Diagram:
RESULT:
VIVA QUESTIONS:
Inputs Outputs
Dec A B Bin Diff Borro
Equi w
0 0 0 0 0 0
1 0 0 1 1 1
2 0 1 0 1 1
3 0 1 1 0 1
4 1 0 0 1 0
5 1 0 1 0 0
6 1 1 0 0 0
7 1 1 1 1 1
Logic Diagram
Components Required:
Sl. No Name of the Component IC number Qty
1 AND gate 7408 1
2 OR gate 7432 1
3 Not gate 7404 1
4 EXOR gate 7486 3
5 NAND gate 7400 3
6 NOR gate 7402 3
7 Patch chords Few
8 Trainer Kit
THEORY:
Full-Adder: The half-adder does not take the carry bit from its previous stage into account.
This carry bit from its previous stage is called carry-in bit. A combinational logic circuit that
adds two data bits, A and B, and a carry-in bit, Cin , is called a full-adder. The Boolean
functions describing the full-adder are:
S = (x y) Cin C = xy + Cin (x y)
Full Subtractor: Subtracting two single-bit binary values, B, Cin from a single-bit value A
produces a difference bit D and a borrow out Br bit. This is called full subtraction. The
Boolean functions describing the full-subtracter are:
D = (x y) Cin Br= A’B + A’(Cin) + B(Cin)
Procedure:
1.Obtain the Boolean Expressions for full adder and full subtractor (sum & Carry) by
writing the truth table and simplifying with the help of K-map.
2.Make the connections as shown in the logic diagram.
3.Apply different combinations of inputs according to the truth table and verify the
outputs.
4.Repeat the above procedure for all the circuit diagrams.
VIVA QUESTIONS:
LOGIC DIAGRAM:
BCD ADDERS:
TRUTH TABLE:
A4 A3 A2 A1 B4 B3 B2 B1 C S4 S3 S2 S1 B D4 D3 D2 D1
1 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0
1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 0
0 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 1 0
0 0 0 1 0 1 1 1 0 1 0 0 0 0 1 0 1 0
1 0 1 0 1 0 1 1 1 0 0 1 0 0 1 1 1 1
1 1 1 0 1 1 1 1 1 1 0 1 0 0 1 1 1 1
1 0 1 0 1 1 0 1 1 0 1 1 1 0 1 1 0 1
EXP. NO : 06 DATE:
FOUR BIT BINARY ADDER
AIM:
To design and implement 4-bit adder and subtractor using IC 7483.
APPARATUS REQUIRED:
SI.No. COMPONENT SPECIFICATION QTY.
1. IC IC 7483 1
2. EX-OR GATE IC 7486 1
3. NOT GATE IC 7404 1
3. IC TRAINER KIT - 1
4. PATCH CORDS - 40
THEORY:
4 BIT BINARY ADDER:
A binary adder is a digital circuit that produces the arithmetic sum of two binary numbers. It
can be constructed with full adders connected in cascade, with the output carry from each full adder
connected to the input carry of next full adder in chain. The augends bits of ‘A’ and the addend bits of
‘B’ are designated by subscript numbers from right to left, with subscript 0 denoting the least
significant bits. The carries are connected in chain through the full adder. The input carry to the adder
is C0 and it ripples through the full adder to the output carry C4.
Consider the arithmetic addition of two decimal digits in BCD, together with an input carry
from a previous stage. Since each input digit does not exceed 9, the output sum cannot be greater than
19, the 1 in the sum being an input carry. The output of two decimal digits must be represented in
BCD and should appear in the form listed in the columns.ABCD adder that adds 2 BCD digits and
produce a sum digit in BCD. The 2 decimal digits, together with the input carry, are first added in the
top 4 bit adder to produce the binary sum.
K MAP
Y=S4(S3+S2)
TRUTH TABLE:
PROCEDURE:
1.Connect the IC in AC bread board .
3.Set up the circuit one by one and verify their truth table.
4.Observe the output corresponding to input combinations and entered it in truth table.
RESULT:
VIVA QUESTIONS:
1.What does a 4-bit adder do?
8086 MICROPROCESSOR
The microprocessor development system consists of a set of hardware and software tools. The
hardware of development systems usually contains a standard PC (Personal Computer), printer and an
emulator. The software tools are also called program development tools and they are Editor, Assembler,
and Library builder, Linker, Debugger and Simulator. These software tools can be run on the PC in order
to write, assemble, debug, modify and test the assembly language programs.
EDITOR (TEXT EDITOR):
The Editor is software tool which, when run on a PC, allow the user to type/enter and modify the
assembly language program. The editor provides a set of commands for insertion, deletion, modifications
of letters, characters, statements, etc., The main faction of an editor is to help the user to constrict the
assembly language program in the right format. The program created using editor is known as source
program and usually it is saved with file extension “ASM”.
ASSEMBLER:
The assembler is a software tool which run on a PC, converts the assembly language program to
machine language program. Several types of assemblers are available and they are one pass assembler,
two pass assembler, macro assembler, cross assembler, resident assembler and Meta assembler.
One Pass Assembler: In the one pass assembler source code is processed only once, and we can use
only backward reference.
Two Pass Assembler: Most of the popularly used assemblers are two pass assembler. In two pass
assembler, the first pass is made through source code for the purpose of assigning an address to all the
labels and to store this information in a symbol table. The second pass is made to actually translate the
source code into machine code.
Some examples of assemblers are TASM (Borland’s Turbo Assembler), MASM (Microsoft
Macro Assembler), ASM86 (INTEL’S 8086 Assembler), etc,.
TASM:
The Turbo Assembler (TASM) mainly PC-targeted assembler package was Borland’s offering in
the X86 assembler programming tool market. As one would expect, TASM worked well with Borland’s
high-level language compilers for the PC, such as Turbo Pascal, Turbo Basic and Turbo C. Along with
the rest of the Turbo suite, Turbo Assembler is no longer maintained.
The Turbo Assembler package came bundled with the linker Turbo Linker, and was
PROGRAM:
MASM:
The Microsoft Macro Assembler (abbreviated MASM) is an x86 high-level assembler for DOS and
Microsoft Windows. Currently it is the most popular x86 assembler. It supports a wide variety of macro
facilities and structured programming idioms, including high-level functions for looping and procedures.
Later versions added the capability of producing programs for Windows. MASM is one of the few
Microsoft development tools that target 16-bit, 32-bit and 64-bit platforms. Earlier versions were MS-DOS
applications. Versions 5.1 and 6.0 were OS/2 applications and later versions were Win32 console
applications. Versions 6.1 and 6.11 included Phar Lap’s TNT DOS extender so that MASM could run in
MS-DOS.
MASM can be used along with a link program to structure the codes generated by MASM in the
form of an executable file. This assembler reads the source program as its inputs and provides an object
file. The link accepts the object file produced by this MASM assembler as input and produces an EXE file.
The effective execution of a program in assembly language we need the following
1. MASM assembler
2. NE (Norton’s Editor) editor (or) Edlin editor
3. Linker
4. Debug utility of DOS
LIBRARY BUILDER:
VEMU INSTITUTE OF TECHNOLOGY, Dept of ECE. Page 32
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
EXP.NO: 01 DATE:
AIM: To Write an ALP for the addition and subtraction of two 8 bit numbers using TASM software.
APPARATUS REQUIRED:
i) PC
ii) TASM software
ALGORITHM:
FLOWCHART:
PROGRAM
ADDITION:
.MODEL SMALL
.STACK 100
.DATA
OPR1 DB 0F8H
OPR2 DB 67H
RES DB 2 DUP(?),’$’
.CODE
MOV AX,@DATA
MOV DS,AX
MOV AL,OPR1
MOV BL,OPR2
ADD AL,BL
MOV RES,AL
MOV AL, 00H
RCL AL,01
MOV [RES+1],AL
MOV AH,09H
MOV DX,OFFSET RES
INT 21H
MOV AH,4CH
INT 21H
END
RESULT:.
INPUT: 2 OPR1 =
OPR2 =
OUTPUT: RES =
VEMU INSTITUTE OF TECHNOLOGY, Dept of ECE. Page 39
8-BIT SUBTRACTION:
Address Opcode Field Label Mnemonic Operand Comment Field
Field Field Field Field
MOV CX,0000H ; it loads 0000H to CX
MOV SI,3000H ;it loads offset address3000 to SI
MOV AL,[SI] ;it moves the contents of [SI] to AL`
register
INC SI ; it increments SI register by 1
MOV BL,[SI] ;it moves the contents of [SI] to BL
register
SUB AL,BL ;Sub AL,BL
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
PROGRAM OF SUBTRACTION:
.MODEL SMALL
.STACK 100
.DATA
OPR1 DB 0F8H
OPR2 DB 67H
RES DB 2 DUP(?),’$’
.CODE
MOV AX,@DATA
MOV DS,AX
MOV AL,OPR1
MOV BL,OPR2
SUB AL,BL
MOV RES,AL
MOV AL, 00H
RCL AL,01
MOV [RES+1],AL
MOV AH,09H
MOV DX,OFFSET RES
INT 21H
MOV AH,4CH
INT 21H
END
RESULT:.
INPUT: 2 OPR1 =
OPR2 =
OUTPUT: RES =
CONCLUSION:
VIVA QUESTIONS:
1.What is the function of LXI H, 8000 H instruction?
16-BITADDITION:
MEMORY MEMORY
DATA DATA
LOCATION LOCATION
AIM: To write an ALP for the addition of two 16 bit numbers using TASM software.
APPARATUS REQUIRED:
i) PC
ii) TASM software
ALGORITHM:
.MODEL SMALL
.STACK 100
.DATA
OPR1 DW 8888H
OPR2 DW 6666H
RES DW 3 DUP(?),’$’
.CODE
MOV AX,@DATA
MOV DS,AX
MOV AX,OPR1
MOV BX,OPR2
ADD AX,BX
MOV RES,AX
MOV AL, 00H
RCL AL,01H
MOV [RES+2],AX
MOV AH,09H
MOV DX,OFFSET RES
INT 21H
MOV AH,4CH
INT 21H
END
RESULT:
INPUT: 2 OPR1 =
OPR2 =
OUTPUT: RES =
CONCLUSION:
VIVA QUESTIONS:
1)How many bit 8086 microprocessor is?
; it increments SI register by 1
INC SI
;it moves the contents of AH register to[SI]
MOV [SI],AH
INT 03
it ends the program
OBERVATION TABLE:
8 BIT MULTIPLICATION:
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
AIM: To write an ALP for the multiplication of two 8 bit numbers using TASM software.
APPARATUS REQUIRED:
i) PC
ii) TASM software
ALGORITHM:
FLOWCHART:
PROGRAM:
.MODEL SMALL
.STACK 100
.DATA
OPR1 DB 05H
OPR2 DB 03H
RES DB 2 DUP(?),’$’
.CODE
MOV AX,@DATA
MOV DS,AX
MOV AL,OPR1
MOV BL,OPR2
MUL BL
MOV RES,AL
MOV [RES+1],AH
MOV AH,09H
MOV DX,OFFSET RES
INT 21H
MOV AH,4CH
INT 21H
END
RESULT:-
INPUT: 2 OPR1 =
OPR2 =
OUTPUT: RES =
CONCLUSION:
VIVA QUESTIONS:
1.Define bit, byte and word
8 BIT DIVISION:
DIV BL ;div BL
INC SI ; it increments SI register by 1
MOV [SI],AL ;it moves the contents of AL register to[SI]
; it increments SI register by 1
INC SI
;it moves the contents of AH register to[SI]
MOV [SI],AH
it ends the program
INT 03
OBERVATION TABLE:
8 BIT DIVISION:
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
AIM: To write an ALP for the division of two 8 bit numbers using TASM software.
APPARATUS REQUIRED:
i) PC
ii) TASM software
ALGORITHM:
PROGRAM:
.MODEL SMALL
.STACK 100
.DATA
OPR1 DB 31H
OPR2 DB 02H
RES DB 2 DUP(?),’$’
.CODE
MOV AX,@DATA
MOV DS,AX
XOR AX,AX
MOV AL,OPR1
MOV BL,OPR2
DIV BL
MOV RES,AL
MOV [RES+1],AH
MOV AH,09H
MOV DX,OFFSET RES
INT 21H
MOV AH,4CH
INT 21H
END
RESULT:
INPUT: 1 OPR1 = 31 H
OPR2 = 02 H
INPUT: 2 OPR1 =
OPR2 =
OUTPUT: QUE =
REM =
CONCLUSION:
EXP. NO : 05 DATE:
APPARATUS REQUIRED:
ALGORITHM:
FLOWCHART:
PROGRAM:
.MODEL SMALL
.STACK 100
.DATA
LIST DB 56H,12H,72H,32H,13H
COUNT EQU ($-LIST)
.CODE
MOV AX,@DATA
MOV DS,AX
MOV CX,COUNT
MOV DX,CX
MOV AH,4CH
INT 21H
END
B.DESCENDING ORDER
B.DESCENDING ORDER
APPARATUS REQUIRED:
ALGORITHM:
FLOWCHART:
PROGRAM:
.MODEL SMALL
.STACK 100
.DATA
LIST DB 56H,12H,72H,32H,13H
COUNT EQU ($-LIST)
.CODE
MOV AX,@DATA
MOV DS,AX
MOV CX,COUNT
MOV DX,CX
MOV AH,4CH
INT 21H
END
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
OBERVATION TABLE:
DECENDING ORDER
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
RESULT:
CONCLUSION:
.
VIVA QUESTIONS:
1. Give the concept of Jump with return and jump with non return.
SMALLEST NUMBER:
[SI],AX
MOV ; move AX content to SI register
OBERVATION TABLE:
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
EXP. NO : 06 DATE:
APPARATUS REQUIRED:
ALGORITHM:
FLOWCHART:
[SI],AX
MOV ; move AX content to SI register
OBERVATION TABLE:
INPUT OUTPUT
MEMORY MEMORY
LOCATION DATA LOCATION DATA
PROGRAM:
. MODEL SMALL
. STACK
. DATA
LIST DB 05H,06H,03H,02H,09H,”$’
.CODE
MOV AX,@DATA
MOV DS,AX
MOV CL,04H
MOV AL,00H
MOV SI,OFFSET LIST
MOV AL,[SI]
L1: CMP AL,[SI+1]
JNC L ; Instead of JNC (JC for smallest)
XCHG AL,[SI+1]
L: INC SI
DEC CL
JNZ L1
MOV SI,3000H
MOV [SI],AL
INT 03H
CODE ENDS
end start
RESULT:
OUTPUT: 1 AL=09h
OUTPUT: 2 AL=02h
VEMU INSTITUTE OF TECHNOLOGY, Dept of ECE. Page 77
RESULT:
CONCLUSION:
.
VIVA QUESTIONS:
ADVANCED EXPERIMENTS
LOGIC DIAGRAM:
BINARY TO GRAY CODE CONVERTOR
G3 = B3
EXP. NO : DATE:
4-BIT BINARY TO GRAY CODE CONVERTER
APPARATUS REQUIRED:
Sl.No. COMPONENT SPECIFICATION QTY.
THEORY:
The availability of large variety of codes for the same discrete elements of
information results in the use of different codes by different systems. A conversion circuit
must be inserted between the two systems if each uses different codes for same
information. Thus, code converter is a circuit that makes the two systems compatible
even though each uses different binary code.
The bit combination assigned to binary code to gray code. Since each code uses
four bits to represent a decimal digit. There are four inputs and four outputs. Gray code is
a non-weighted code.
The input variable are designated as B3, B2, B1, B0 and the output variables are
designated as C3, C2, C1, Co. from the truth table, combinational circuit is designed. The
Boolean functions are obtained from K-Map for each output variable.
A code converter is a circuit that makes the two systems compatible even though
each uses a different binary code. To convert from binary code to Excess-3 code, the
input lines must supply the bit combination of elements as specified by code and the
output lines generate the corresponding bit combination of code. Each one of the four
maps represents one of the four outputs of the circuit as a function of the four
TRUTH TABLE:
Binary input | Gray code output |
B3 B2 B1 B0 G3 G2 G1 G0
0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1
0 0 1 0 0 0 1 1
0 0 1 1 0 0 1 0
0 1 0 0 0 1 1 0
0 1 0 1 0 1 1 1
0 1 1 0 0 1 0 1
0 1 1 1 0 1 0 0
1 0 0 0 1 1 0 0
1 0 0 1 1 1 0 1
1 0 1 0 1 1 1 1
1 0 1 1 1 1 1 0
1 1 0 0 1 0 1 0
1 1 0 1 1 0 1 1
1 1 1 0 1 0 0 1
1 1 1 1 1 0 0 0
derived by the maps. These are various other possibilities for a logic diagram that implements this
circuit. Now the OR gate whose output is C+D has been used to implement partially each of three
outputs.
PROCEDURE:
(iii) Observe the logical output and verify with the truth tables.
RESULTS:
CONCLUSION:
VIVAQUESTIONS:
2.How many valid inputs will a 4 bit binary to Gray code converter have?
APPARATUS REQUIRED:
(i) 8086 Microprocessor Kit
(ii) TASM Software/Win86E
(iii) FPS (+5V)
(iv) PC
(v) USB Cable
ALGORITHM:
PROGRAM:
ASM code:
. Model small
. Stack
. Data
Num1 DW 0005h
Num2 DW 0002h
Ans DW ?
. Code
Mov AX, @data
Mov DS,AX
Mov AX,Num1
Mov BX,Num2
Mov dX,0000h
Next: Push AX
Push DX
Div BX
Cmp DX,0000h
JE LAST
POP DX
POP AX
Add AX,Num1
JNC Next
LAST: Pop Ans+2
Pop Ans
Mov AH,4ch
Int 21h
End
INPUT:
OUTPUT:
RESULT:
CONCLUSION:
VIVA QUESTIONS:
1. What is stack?
3. What is an Interrupt?
4. What is a compiler?