Escolar Documentos
Profissional Documentos
Cultura Documentos
COMPUTER ORGANIZATION
CODE : CS406ES
3. Design and Implement the 4:1 MUX, 8:1 MUX using gates IC’S
1. AND Operation:
00
1 00
31
2 3
2
2. NOT Operation:
03
1
3
2
3. OR Operation:
03
1
3
2
03
1
3
2
03
1
3
2
4. XOR & XNOR Operation:
1. AND Operation: 02
2
1
3
02
2
1
3
02
2
1
3
2. NOT Operation:
02
2
1
3
3. OR Operation:
02
2 02
1 2
3 1
3
PROCEDURE:
PART (A):
PRECAUTIONS:
shorting of pins.
RESULT:
The truth tables of individual gates are verified and their realizations using
NAND gates alone and NOR gates alone have been verified.
SAMPLE QUESTIONS:
1. If one of the inputs of an EX-OR gate is high, its output will be--------
(same as other input/inverse of other input).
2. To INHIBIT( or DISABLE) an AND gate one of its input is connected to logic level------(0/1).
3. To DISABLE a NOR gate one of its inputs needs to be connected
to logic level-------------(0/1)
Procedure:
1. For the verification of half adder the connection are made as per the logic diagaram.
2. Inputs are given and the functionality of half adder are verified
3. For the verification of Full Adder the connections are made as per the logic diagram.
4. Inputs are given and the functionality of the Full Adder are verified
PRECAUTIONS: -
PART (A):
1. Suitable power supply connections and chip enable signals are given at the
I2,…..I7) are connected to 8 input toggle switches and the output pins
3. The selection lines pins (S2, S1, S0) are connected to three input toggle
switches.
1. The selection lines are varied from binary 000 to 111 and we will observe the
data at the corresponding inputs ( 0 or 1) will find its way to the output.
PART (B):
1. First, identify the size of MUX needed for implementing the given circuit
using MUX.
2. Complete the procedure for implementing any Boolean function using MUX.
Three input variables of the function are connected to selection lines pins
And the fourth input variable is given as input to the MUX as per the table.
3. The corresponding inputs from the derived table are given to the MUX IC
4. The 4 input variables are varied from 0000 to 1111 and the truth table for the
PRECAUTIONS:
chip.
SAMPLE QUESTIONS:
AIM: A) To verify the operation of binary to Octal decoder IC 74138 and realize
4 to 16 line decoder using 3 to 8 decoders
B) To implement a Full adder circuit using decoder and basic gates
APPARATUS:
Expressions:
CIRCUIT DIAGRAM:
PROCEDURE:
PART (A):
1. Power supply connections are made at pins 8(GND) and 16(Vcc) of 74138 IC.
2. To enable the chip operation, the corresponding enable pins are given signals. E1′, E2′,
E3’ are connected to LOW, LOW and HIGH respectively.
3. To verify the operation of binary to Octal decoder, three input pins A2, A1, A0 are
connected to input toggle switches and eight outputs O0′, O1′, O2′,.. O7′, are connected to
output indicators and the truth table is verified.
4. To extend this 3 to 8 line decoder into a 4 to 16 line decoder, two separate 74138 ICs are
taken and connections are made as per the circuit diagram (i) and the truth table is
verified.
PRECAUTIONS:
2. The corresponding chip enable signals must be enabled for normal operation.
3. Care must be taken to ensure that there are no shorting of pins
4. It is always good practice to ensure the correct operation of individual gates which are used
as part of the circuit.
Apparatus Required: IC 7485, 4-BIT Digital Comparator Trainer Kit, Patch Chords
IC Pin Description :
Truth Table
LOGIC DIAGRAM: 2 BIT MAGNITUDE COMPARATOR
PROCEDURE:
RESULT:
SHIFT REGISTERS
PART (A):
1. The function table for the 7474 shows the mode of operation of the register.
When the clear input goes to 0, the four flip-flops clear to 0 asynchronously,
That is, without the need of a clock. Synchronous operations are affected by
a positive transition of the clock. To load the input data, the PRE must be
2. Make connections according to the pin assignment to the inputs and outputs
as shown in fig.
3. Vary the inputs and verify all the operations listed in the function table of the
7474 IC.
PRECAUTIONS:
RESULT:
SAMPLE QUESTIONS:
4. What is serial and parallel loading of register? How to convert serial data to parallel and parallel
data to serial? What type of register is used?
6. How many no. of states a) a 5-bit ring counter b) a 5-bit Johnson counter will go
through?
EXPERIMENT NO: 7
AIM: To construct and test decade decimal BCD counter using 7490 IC
Pin description
MOD-10 COUNTER:
BLOCK DIAGRAM
PROCEDURE:
1. No pins must be left open. If we are not using particular pins in that
The 4- bit Asynchronous counter decade BCD counters constructed and their operation is verified.
SAMPLE QUESTIONS:
1. Draw the timing diagrams showing the relationship between clock and the four outputs of 4- bit
UP counter(Ripple)
4. How do you determine the maximum frequency range of a given n- bit counter?
8. What is the difference between edge triggered and level triggered circuits?
10. Draw the logic diagram of 4-bit binary ripple down counter.
SAMPLE QUESTIONS:
3. The count of a 4- bit binary DOWN counter is 0000. When a clock pulse is applied its count
will be--------------.
4. The cascade of divide- by 5 counter followed by divide-by-2 counter is in state 0000. When a
clock pulse is applied, its state will be ----------------.
5. State some commonly available synchronous counter ICs with their features?
2. Write an ALP of 8086 to take N numbers as input. And do the following operations on
them.
a. Arrange in ascending and descending order.
3. Write an ALP of 8086 to take N numbers as input. And do the following operations on
them.
a. Find max and minimum
b. Find average
Considering 8-bit, 16 bit binary numbers and 2 digit, 4digit and 8 digit BCD numbers.
Display the results by using “int xx” of 8086. Validate program for the boundary
conditions.
4. Write an ALP of 8086 to take a string of as input (in ‘C’ format)and do the following
Operations on it.
a. Find the length
b. Find it is Palindrome or n.
Considering 8-bit, 16 bit binary numbers and 2 digit, 4digit and 8 digit BCD numbers.
Display the results by using “int xx” of 8086. Validate program for the boundary
conditions.
5. Write an ALP of 8086 to take a string of as input (in ‘C’ format) and do the following
Operations on it.
Find whether given string substring or not.
6. Write an ALP of 8086 to take a string of as input (in ‘C’ format) and do the following
Operations on it
a. Find the Armstrong number
b. Find the Fibonacci series for n numbers
Display the results by using “int xx” of 8086.
7. Write the ALP to implement the above operations as procedures and call from the main
procedure.
8. Write an ALP of 8086 to find the factorial of a given number as a Procedure and call from
a. the main program which display the result
EXPERIMENT 1
ARTHIMATIC OPERATIONS
AIM: To Write assembly language programs to evaluate the expressions:
i) a = b + c – d * e
ii) z = x * y + w – v +u / k
TOOLS:
GNU Assembler
PROGRAM:
i) a=b+c-d*e
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.data
.code
main PROC
mov ax,@data
mov ds,ax
mov ax,3333h
mov bx,2222h
ADD ax,bx
SUB ax,4321h
mov bx,03h
mul bx
call DumpRegs
exit
main ENDP
END main
ii) z = x * y + w – v +u / k
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.data
.code
main PROC
mov ax,@data
mov ds,ax
mov ax,1234h
mov bx,5h
mul bx
ADD ax,01abh
SUB ax,111ah
mov cx,ax
mov ax,10h
mov bx,08h
div bx
mov bx,ax
mov ax,cx
add ax,bx
call DumpRegs
exit
main ENDP
END main
EXPERIMENT 2
AIM : To write an ALP of 8086 to take N numbers as input. And do the following operations on
them.
a. Arrange in ascending and descending order.
TOOLS:
GNU Assembler
PROGRAM:
i)for assending order
title (.asm)
;this program
;last update:
include masm16.inc
.data
string1 db 88h,12h,56h,45h,36h
.code
main proc
mov ax,@data
mov ds,ax
mov ch,04h
up2: mov cl,04h
lea si,string1
up1: mov al,[si]
mov bl,[si+1]
cmp al,bl
jc down
mov dl,[si+1]
xchg [si],dl
mov [si+1],dl
down: inc si
dec cl
jnz up1
dec ch
jnz up2
mov al,[si]
mov ah,[si-1]
mov bl,[si-2]
mov bh,[si-3]
mov cl,[si-4]
call dumpregs
exit
main endp
end main
title (.asm)
;this program
;last update:
include masm16.inc
.data
string1 db 99h,12h,56h,45h,36h
.code
main proc
mov ax,@data
mov ds,ax
mov ch,04h
up2: mov cl,04h
lea si,string1
up1:mov al,[si]
mov bl,[si+1]
cmp al,bl
jnc down
mov dl,[si+1]
xchg [si],dl
mov [si+1],dl
down: inc si
dec cl
jnz up1
dec ch
jnz up2
mov al,[si]
mov ah,[si-1]
mov bl,[si-2]
mov bh,[si-3]
mov cl,[si-4]
call dumpregs
exit
main endp
end main
EXPERIMENT 3
AIM: . To write an ALP of 8086 to take N numbers as input. And do the following operations on
them.
a. Find max and minimum
b. Find average
TOOLS: GNU Assembler
PROGRAM:
i) For maximum number
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.data
STRING1 DB 08h,14h,05h,0Fh,09h
.code
main PROC
mov ax,@data
mov ds, ax
mov cx, 04h
;this program
;last update:
INCLUDE masm16.inc
.data
STRING1 DB 08h,14h,05h,0Fh,09h
.code
main PROC
mov ax, @data
mov ds, ax
mov cx, 04h
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.data
A DB 1h,2h,3h,4h,5h,6h,10h,8h,9h,0ah
.code
main PROC
MOV AX,@data
MOV DS,AX
LEA BX,A
MOV CL,10
MOV AX,0000
L1:ADD AL,BYTE PTR[BX]
INC BX
DEC CL
CMP CL,00
JNZ L1
MOV BH,10
DIV BH
call DumpRegs
exit
main ENDP
END main
EXPERIMENT 4
AIM : To write an ALP of 8086 to take a string of as input (in ‘C’ format)and do the following
Operations on it.
a. Find the length
b. Find it is Palindrome or n.
TOOLS: GNU Assembler
PROGRAM:
i) To find the length of given string
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.DATA
STR DB ‘GANGADHAR$’
MSG1 DB 10,13,’THE STRING IN THE MEMORY IS : $’
MSG2 DB 10,13,’LENGTH OF THE STRING IS :- $’
LEN DB 0H
.CODE
main PROC
MOV AX,@DATA
MOV DS,AX
DISPLAY MSG1
DISPLAY STR
LEA SI,STR
NEXT:
CMP [SI],’$’
JE DONE
INC LEN
INC SI
JMP NEXT
DONE:
DISPLAY MSG2
MOV AL,LEN
ADD AL,30H
MOV DL,AL
MOV AH,2
INT 21H
MOV AH,4CH
INT 21H
call DumpRegs
exit
main ENDP
END main
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.data
block1 db 'malayalam'
msg1 db "it is palindrome $"
msg2 db "it is not palindrome $"
pal db 00h
mov ah,09h
lea dx,msg
int 21h
int 3h
endm
.extra
block2 db 9 dup(?)
.code
main PROC
mov ax,@data
mov ds,ax
mov ax,extra
mov es,ax
lea si,block1
lea di,block2+8
mov cx,00009h
back: cld
lodsb
std
stosb
loop back
lea si,block1
lea di,block2
mov cx,0009h
cld
repz cmpsb
jnz skip
print msg1
skip: print msg2
call DumpRegs
exit
main ENDP
END main
EXPERIMENT 5
AIM: To write an ALP of 8086 to find whether given string substring or not.
TOOLS: GNU Assembler
PROGRAM:
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.DATA
STR DB ‘AXYBCSDEF$’
SUBSTR DB ‘BCS$’
LEN1 DB 0
LEN2 DB 0
MSG1 DB 10,13,’STRING IS : $’
MSG2 DB 10,13,’SUBSTRING IS : $’
MSG3 DB 10,13,’SUBSTRING IS FOUND AT POSITION : $’
POS DB -1
RTN DB ‘-1$’
.CODE
main PROC
MOV AX,@DATA
MOV DS,AX
DISPLAY MSG1
DISPLAY STR
DISPLAY MSG2
DISPLAY SUBSTR
LEA SI,STR
NXT1:
CMP [SI],’$’
JE DONE1
INC LEN1
INC SI
JMP NXT1
DONE1:
LEA DI,SUBSTR
NXT2:
CMP [DI],’$’
JE DONE2
INC LEN2
INC DI
JMP NXT2
DONE2:
DISPLAY MSG3
LEA SI,STR
MOV AL,LEN1
SUB AL,LEN2
MOV CL,AL
MOV CH,0
FIRST:
INC POS
MOV AL,[SI]
CMP AL,SUBSTR[0]
JE CMPR
INC SI
LOOP FIRST
CMPR: INC SI
MOV AL,[SI]
CMP AL,SUBSTR[1]
JNE NOTEQUAL
INC SI
MOV AL,[SI]
CMP AL,SUBSTR[2]
JE EQUAL
NOTEQUAL:
MOV POS,-1
DISPLAY RTN
JMP EXIT
EQUAL:
MOV DL,POS
ADD DL,30H
MOV AH,2
INT 21H
call DumpRegs
exit
main ENDP
END main
EXPERIMENT 6
AIM: To write an ALP of 8086 to take a string of as input (in ‘C’ format) and do the following
Operations on it
Find the Fibonacci series for n numbers
TITLE (.asm)
;this program
;last update:
INCLUDE masm16.inc
.DATA
RES DB ?
CNT DB 0AH ; Initialize the counter for the no of Fibonacci No needed
.CODE
main PROC
MOV AX,@DATA
MOV DS,AX
LEA SI,RES
MOV CL,CNT ; Load the count value for CL for looping
MOV AX,00H ; Default No
MOV BX,01H ; Default No
;Fibonacci Part
L1:ADD AX,BX
DAA ; Used to Present the value in Decimal Form
MOV [SI],AX
MOV AX,BX
MOV BX,[SI]
INC SI
LOOP L1
call DumpRegs
exit
main ENDP
END main
EXPERIMENT 8
AIM: To write an ALP of 8086 to find the factorial of a given number as a Procedure and call
from the main program which display the result
TOOLS: GNU Assembler
PROGRAM:
DATA SEGMENT
NUM DB ?
FACT DB 1H
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
MOV AH,1
INT 21H
SUB AL,30H
MOV NUM,AL
MOV AH,0
MOV AL,FACT
MOV CH,0
MOV CL,NUM
LABEL1: MUL CL
LOOP LABEL1
LEA SI,RES
CALL HEX2DEC
LEA DX,MSG2
MOV AH,9
INT 21H
LEA DX,RES
MOV AH,9
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
MOV CX,0
MOV BX,10
DIV BX
ADD DL,30H
PUSH DX
INC CX
CMP AX,9
JG LOOP1
ADD AL,30H
MOV [SI],AL
LOOP2: POP AX
INC SI
MOV [SI],AL
LOOP LOOP2
RET
HEX2DEC ENDP
END START