Lab Manual
Lab Manual
LAB MANUAL
(ACADEMIC RECORD)
CLASS: SE
SEMESTER: IV
Department Mission :
M1 To create and disseminate knowledge through research, teaching & learning and to
: enhance society in meaningful and sustainable ways.
M2 To impart a suitable environment for students and staff to showcase innovative ideas in
: the field of IT.
M3 To bridge the curriculum gap by facilitating effective interaction among industry and
: Staff/Students.
PEO2 - Attain the ability to adapt quickly to new environments and technologies,
assimilate new information, and work in multi-disciplinary areas with a strong focus
on innovation and entrepreneurship.
PEO3 - Prepare graduates with the ability of life-long learning to innovate in ever-
changing global economic and technological environments of the current era.
PEO4 - Possess the ability to function ethically and responsibly with good cultural values
and integrity to apply the best principles and practices of Information Technology
towards the society.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
PSO1 - Apply Core Information Technology knowledge to develop stable and secure IT
system
PSO2 - Design, IT infrastructures for an enterprise using concepts of best practices in
Information Technology and security domain.
PSO3 - Ability to work in multidisciplinary IT enabled projects for industry and society by
adapting latest trends and technologies like Analytics, Blockchain, Cloud, Data science.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Course Outcomes
ITL403.1 Demonstrate various components and peripheral of computer system
ITL403.4 Develop the assembly level programming using 8086 loop instruction set
ITL403.5 Write programs based on string and procedure for 8086 microprocessor.
List of Experiments
Course Name : Microprocessor Lab
Datta Meghe College of Engineering
Course Code : ITL403
Airoli, Navi Mumbai
EXPERIMENT 01
Date of Performance:
Date of Submission:
2. South Bridge: South bridge is another chip of the logical chipset architecture. It is located to
the South of Peripheral Component Interconnect (PCI) bus in the motherboard. The main
function of South bridge is to control the IO functioning. The North bridge is the medium that
connects South bridge and Central Processing Unit. IO Controller Hub is the other name given to
South bridge for its functionality.
INTERNAL COMPONENTS
1. Mouse & keyboard: Keyboard Connectors are two types basically. All PCs have a Key board
port connected directly to the motherboard. The oldest, but still quite common type, is a special
DIN, and most PCs until recently retained this style connector. The AT-style keyboard connector
is quickly disappearing, being replaced by the smaller mini–DIN PS/2-style keyboard connector.
2. USB (Universal serial bus): USB is the General-purpose connection for PC. You can find
USB versions of many different devices, such as mice, keyboards, scanners, cameras, and even
printers. a USB connector's distinctive rectangular shape makes it easily recognizable.
3. Parallel port: Most printers use a special connector called a parallel port. Parallel port carry
data on more than one wire, as opposed to the serial port, which uses only one wire. Parallel
ports use a 25-pin female DB connector. Parallel ports are directly supported by the motherboard
through a direct connection or through a dangle.
4.CPU-Chip: The CPU, also called the microprocessor performs all the calculations that take
place inside a pc. CPUs come in Variety of shapes and sizes. Modern CPUs generate a lot of heat
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Study of PC Motherboard Technology (South Bridge & North Bridge), Internal Components and
Connections used in computer system was successfully learnt.
-------------------------------------------------------------------------------------------
EXPERIMENT 02
Date of Performance:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Aim: To study and verify the truth table of various logic gates.
Resources required: Logisim application
1) NOT Gate
2) AND Gate
3) OR Gate
B)Derived Gates
1) NOR Gate
2) NAND Gate
3) XOR Gate
4) XNOR Gate
Out of these gates, NOR and NAND gates are called “universal gates”, because by
using these gates exclusively we can construct all other logic gates.
A) Basic Gates
1. NOT Gate:
The simplest gate is the NOT gate, also known as an inverter.
It accepts a single input and outputs the opposite value. i.e. if the input is 0,
the output is 1 and vice versa
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Symbol:
Expression:
Truth Table:
2) AND Gate:
In AND gate there are two inputs and one output.
In AND gate the output of an AND gate attains the state 1 if and only if all
the inputs are in state 1.
Symbol:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
3) XOR Gate:
XOR gate is also called as “Exclusive OR” gate.
It is a digital logic gate that implements an Exclusive OR, i.e. the result
(output) is 1 only if one of the input is 1.
That is XOR gate is a digital logic gate that generates 1 in output when the
number of 1 input is odd.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
CONCLUSION
Various logic gates, its symbol, and truth table was successfully learnt.
------------------------------------------------------------------------------------
EXPERIMENT 03
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Aim: To study and verify the truth table and the functionality of :
1) Half Adder 2) Full Adder 3) Half Subtractor 4) Full Subtractor using
Simulator
Combinational logic is used to build circuits that produce specified outputs from certain
inputs.
The various logic gates are the building blocks of combinational logic circuits.
Examples of Combinational Logic Circuit are half adders, full adders, multiplexers,
demultiplexers, encoders and decoders ,etc.
1) HALF - ADDER
It is the combinational logic circuit is derived by using two inputs and two outputs.
The circuit design allowed us to add two one-bit binary numbers. So, the main purpose of
using half adder is for addition.
With the inputs as A and B,and there are two output bits; one of which is the sum bit SUM
and the other is the carry bit CARRY.
2) FULL - ADDER
Full adder is the three input two output combinational logic circuit which add three single bits
applied at its input to produce SUM and CARRY outputs,
The simplest way to construct a full adder is to connect two half- adder and an OR gate.
3) HALF - SUBTRACTOR
☟alf subtractor is the combinational circuit with its two input and two outputs (difference and
borrow) .
It produces difference between two binary bit at the inputs and also produces an output Borrow that
indicate if a 1 has been borrowed.
The difference can be applied using X-OR Gate, borrow output can be implemented using an AND
Gate and an inverter.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
4) FULL - SUBTRACTOR
Full subtractor is the combinational circuit with three inputs and two outputs.
The expression AB assembles the borrow output of the half subtractor and the second term is the
inverted difference output of first X-OR.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Conclusion:
According to the above observations, simulation output and truth table of respective circuit matches.
-------------------------------------------------------------------------------------------
EXPERIMENT 04
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
CIRCUIT:
TRUTH TABLE:
Procedure:
EXPERIMENT 05
Date of Performance:
Date of Submission:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Aim : To simulate assembly language program for 8bit and 16bit addition
Assembler Directives:
Assembler Directives are instructions entered into the source code along with the assembly
language. Pseudo instructions (Assembler Directives) do not get translated into object code, but
are used as special instructions to the assembler to perform some special functions. The
directives control the generation of machine code and organization of the program.
The assembler directives are classified into the following categories based on the functions
performed by them. They are
Data definition directives are used to define the program variables and allocate a specified
amount of memory to them. They are of type BYTE, WORD, Double Word, Quad Word and Ten
Byte and their size in bytes are 1,2,4,8 and 10 respectively. The data definition directives are DB,
DW, DD, DQ, DT.
DB – [Define Byte]
The DB directive is used to define a byte–type variable or to set aside one or more storage
locations of type byte in memory. It can be used to define single or multiple byte variables.
6) sum db 25 dup(?)
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
DW – [Define Word]
The DW directive is used to declare a variable of type word, or to reserve storage locations of
type word in memory.
DD – [define double word]:The DD directive is used to declare a variable of type double word.
DQ – Define Quad word :The directive DQ is used to define a quad word ( 8 bytes) type
variable.
DT – Define Ten bytes :The directive DT is used to define a Ten bytes type variable.
ENDS :- [end segment ] : This directive is used with the name of a segment to indicate the end
of the logical segment. ENDS is used with the segment directive to ‘bracket’ a logical segment
containing instructions or data.
ASSUME : ASSUME tells the assembler what names have been chosen for Code, Data Extra
and Stack segments. Informs the assembler that the register CS is to be initialized with the
address allotted by the loader to the label CODE and DS is similarly initialized with the address
of label DATA.
Example
c)Alignment Directives
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
ORG : Originate : The directive ORG assigns the location counter with the value specified in the
directive. It helps in placing the machine code in the specified location while translating the
instructions into machine codes by the assembler.
ORG 100
The above statement informs the assembler to initialize the location counter to 100.
END :( END PROGRAM) The END directive is put after the last statement of a program to tell
the assembler that this is the end of the program module. A carriage return is required after the
END directive. The last statement of every program must be an end directive.
LENGTH: The directive length informs the assembler about the number of elements in a data
item such as an array. If an array is defined with DB then it returns the number of bytes allocated
to the variable. If an array is defined with DW then it returns the number of words allocated to
the array variable.
SIZE: The directive SIZE is same as LENGTH except that it returns the number of bytes
allocated to the data item instead of the number of elements in it.
OFFSET : The directive OFFSET informs the assembler to determine the displacement of the
specified variable with respect to the base of data segment.
PROC: The PROC directive is used to identify the start of a procedure. The PROC directive
follows a name you give the procedure. After the PROC directive the term NEAR or FAR is used
to specify the type of the procedure.
---------
---------
RET
Factorial ENDP
MACRO: A macro is a group of instructions we bracket and give a name to at the start of our
program. Each time we call the macro in our program, the assembler insert the defined group of
instructions in place of the call.
The MACRO directive is used to identify the start of a macro. The Macro directive follows a
name you give the macro.
--------
--------
This directive is used along with the name of the macro to indicate the end of a macro to the
assembler.
EQU (EQUATE): EQU is used to give a name to some value or symbol. Each time the
assembler finds the given name in the program, it replaces the name with the value or symbol
you equated with that name.
PTR (POINTER) : The PTR operator is used to assign a specific type to a variable or a label. It
is necessary to do this in any instruction where the type of the operand is not clear.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
•INC [BX]
It will not know whether to increment the byte or word pointed to by BX. We use the PTR
operator to clarify how we want the assembler to code the instruction.
This statement tells the assembler that we want to increment the byte pointed to by BX.
.MODEL
The .MODEL statement followed by the size of the memory system designates the Memory
Model.
.CODE
.DATA
.STACK
Overview :In general programming of a microprocessor usually takes several iterations before
the right sequence of machine code instructions is written. The process, however is facilitated
using a special program called an “Assembler”. The assembler allows the user to write
alphanumeric instructions or mnemonics , called Assembly Language instructions. The
assembler in turn generates the desired machine instructions from the Assembly Language
instructions.
STEP PRODUCES
1 Editing Source file
2 Assembling Object file
3 Linking Executable file
4 Executing Results
The assembler is use to convert the Assembly Language instructions to machine code. The
assembler starts by checking the syntax, or validity of the structure, of each instruction in the
source file. If any errors are found, the assembler displays a report on the errors with brief
explanation of their nature. However, if the program does not contain any errors, the assembler
produces an object file that has the same name as the original file but with the “obj” extention.
The linker is used to convert the object file to an executable file. When the assembly language
program is free of error messages ,the next step is to link the object modules. Linker combines if
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
The executable file contains the machine language code. It can loaded in the RAM and be
executed by microprocessor simply typing, from the DOS prompt, the name of the file followed
by the Enter Key. If the program produces an output on the screen, the effect should be noticed
almost immediately. However, if the program manipulates data in memory, nothing would seem
to have happened as a result of executing program.
The Debugger can also be used to find logical errors in the program. Even if a program does not
contain
Syntax errors it may not produce the desired results after execution. Logical errors may be found
by tracing the action of the program. Once found, the source file should be reedited to fix the
problem, then re-assembled and re-linked.
Conclusion:
The Addition of two 8 bit/16 bit numbers is done and the output is Verified.
-----------------------------------------------------------------------------------------
EXPERIMENT 06
Date of Performance:
Date of Submission:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Procedure:
A digit BCD number is available in register AL. We have to unpack this BCD
number i.e. we have to separate the BCD digits. e.g : If the number = 92 H
then in unpack form the two digits will 02 H and 09 H. i.e. we have to mask
the lower nibble, first and rotate four times to the right to get the MSB digit.
Then to get the LSB digit mask the upper nibble. Display the result. Masking
lower nibble means ANDing the number with OF0 to get MSB.
Algorithm:
Step I : Initialize the data memory.
Step II : Load number into register AL.
Step III : Mask the lower nibble.
Step IV : Rotate 4 times left to make ; MSB digit = LSB.
Step V : Display the digit.
Step VI : Load number in AL.
Step VII : Mask upper nibble.
Step VIII : Display the result.
Step IX : Stop.
FLOWCHART:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
CONCLUSION
Program for converting two-digit Packed BCD to Unpacked BCD is simulated.
--------------------------------------------------END---------------------------------------------------
EXPERIMENT 07
Date of Performance:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Aim: Write an Assembly language program to exchange block of data bytes using
string instructions
Algorithm:
1. Initialize the data in the source memory and destination memory
2. Initialize SI and DI with source and destination address
3. Initialize CX register with count
4. Initialize the direction flag to zero
5. Exchange the data blocks byte by byte
6. Decrement CX
7. Increment SI and DI
8. Check for count in CX, if not zero go to step 5 else go to step 9
9. Stop
FLOWCHART:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
CONCLUSION: The exchange of five, data bytes using string is performed and output is
verified.
----------------------------------------END----------------------------------------------
EXPERIMENT 08
Date of Performance:
Date of Submission:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Aim: Assembly language program to count number of 1’s and 0’s in a given 8 bit
number using loop statement and simulate it.
1 . FLOWCHART
Conclusion:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
----------------------------------------END----------------------------------------
EXPERIMENT 09
Date of Performance:
Date of Submission:
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
1. Initialize data segment ,byte counter, and memory pointer to read numbers from array.
2. Read number from array.
3. Increment memory pointer to read next number
4. Decrement byte counter
5. Compare two numbers, IF number < next number then perform step no. 7
6. Replace with next number which is smaller
7. Increment memory pointer to read next number from array
8. Decrement counter by 1
9. If byte counter is not zero then perform step no. 5
10.Store smallest number
11.End
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
.MODEL SMALL
.DATA
ARRAY DB 98H,23H,34H,0AH,10H
SMALLEST DB ?
.CODE
MOV AX,@DATA
MOV DS,AX
MOV CX,04H
MOV SI,OFFSET ARRAY
MOV AL,[SI]
UP: INC SI
CMP AL,[SI]
JNC NEXT
MOV AL,[SI]
NEXT: DEC CX
JNZ UP
MOV SMALLEST,AL
MOV AH,4CH
INT 21H
END
Conclusion: Programs executed to find smallest/largest number and output is verified.
---------------------------------------END---------------------------------------------------
EXPERIMENT 10
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Aim: Assembly language program to compute the factorial of positive integer ‘n’
using procedure and simulate it.
Theory:
segment which is calling that procedure. Only Instruction Pointer (IP register)
contents will be changed in Near procedure.
NEAR procedure.
segment than the calling segment. In this case both Instruction Pointer(IP) and the
Code Segment(CS)
PROC directive: The PROC directive is used to identify the start of a procedure.
The PROC directive
follows a name given to the procedure. After that the term FAR and NEAR is used
to specify the type of
the procedure.
ENDP Directive: This directive is used along with the name of the procedure to
indicate the end of a
procedure to the assembler. The PROC and ENDP directive are used to bracket a
procedure.
…………
operation. When it executes, first it stores the address of instruction after the CALL
instruction on the
stack. Second it changes the content of IP register in case of Near call and changes
the content of IP
Algorithm:
1. Start
2. Initialize data segment
3. Initialize AX=1
4. Load the number in BX
5. CALL procedure FACT
6. Compare BX with 1 .If BX > 1, go to step 8
7. AX = 1 and return back to calling program
8. FACT = AX * BX
9. Decrement BX
10.Compare BX with 1 .If not equal to zero, go to step 8
11.Return back to calling program
12.End
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
------------------------------------------------------END---------------------------
EXPERIMENT 11
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
The hex decimal data corresponding to the segments which have to glow for
displaying a character is output to port B.
DISPLAY FORMAT Let us consider Common Anode display to understand well, the
following table represents the connection format of the Common Anode display
Logic ‘0' in the above format will turn ON that particular segment. Logic ‘1' will
keep the segment OFF. The data for turning ON the display is through 8255 (We
already studied).
Types of Seven segment displays-
Common Cathode 7-segment display:
As the name indicates, its cathode is connected to a common terminal. Below is the
schematic diagram to indicate its common cathode structure. It should be
connected to the ground while operating the display. If a high voltage is given to
the anode, then it will turn on the corresponding segment.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
Display codes:
Display codes are the voltages to be applied to the segments to display a
number. It is in the order of segments ABCDEFG(DP), total 8 bits. For example,
below is the common cathode display code of ‘0’ with decimal point OFF.
Below is a table with display codes of all the digits with decimal point OFF.
DATTA MEGHE COLLEGE OF ENGINEERING
DEPARTMENT OF INFORMATION TECHNOLOGY
----------------------------------------END-------------------------------------