BCSL-022 Solved Assignment 2023-24 - Protected-1
BCSL-022 Solved Assignment 2023-24 - Protected-1
Learning Science
BCSL-022
Solved Assignment
https://learningscience.co.in
BCSL-022 Solved Assignment 2023-2024 (July-January)
.in
Course Code BCSL-022
co
Assignment Number BCA (II)/L-022/Assignment/2023-24
e.
Maximum Marks 50
nc
Weightage 25%
ie
Last Date of Submission
30 th April, 2024 (For January Session)
sc
Note: This assignment has two questions of total of 40 marks. Rest 10 marks are for viva voce. Please go through the guidelines regarding
ng
assignments given in the programme guide for the format of presentation.
Q1. Design a two bit counter circuit that count from the state 00 to 10 only. The state 11 is ignored. The states of the counter, thus, may be
ni
00, 01, 10, 00, 01, 10… Use J-K flip flop to design the circuit. You must design them using state transition diagram and Karnaugh's map.(10)
Q2. Perform the following using 8086 assembly language. (3×10 = 30)
ar
(a) Write and run a program using 8086 assembly language that increments a byte value stored in a memory location by a value 2. The
result should be stored in the same memory location. For example, if a memory location contains 0101 0001, then the program will add 2 to
e
this value and store the result 0101 0011 (after adding 2) in the same location 20.
//l
(b) Write and run a program using 8086 assembly language which finds the highest of four byte values stored in memory. The highest value
s:
(c) Write and run a program using 8086 assembly language that compares the values. of AL and BL registers. In case AL is more than BL,
tp
then program clears BL register otherwise it clears AL register. You can move value '1100 1010' in AL, register and '1100 1000' in BL register,
initially. 1
ht
co
00, 01, 10… Use J-K flip flop to design the circuit. You must design them using state transition diagram and Karnaugh's map. (10)
Solution:
e.
Step 1: State Transition Diagram:
nc
ie
sc
ng
Step 2: Transition Equations
ni
ar
For J-K FF0:
.in
Karnaugh map for J-K FF0:
co
Q1 Q0 00 01 11 10
e.
0 1 0 x 0
1 x x x x
nc
Simplified equation for J0:
ie
J0 = Q1' (from the K-map)
sc
ng
Karnaugh map for J-K FF1:
Q1 Q0 00 01 11 ni10
0 0 1 x 0
ar
1 x x x x
e
//l
.in
K1 = Q0
co
Step 5: Implementation
e.
Circuit Diagram (J-K Flip-Flop):
nc
ie
sc
ng
ni
e ar
//l
s:
Q2. Perform the following using 8086 assembly language. (3×10 = 30)
tp
(a) Write and run a program using 8086 assembly language that increments a byte value stored in a memory location by a value 2. The result should be
stored in the same memory location. For example, if a memory location contains 0101 0001, then the program will add 2 to this value and store the 4
ht
.in
ORG 100h ; Origin of the program, typically 100h for .COM programs
co
MOV SI, 20 ; SI register holds the memory location address
MOV AL, [SI] ; Load the byte value from memory into AL register
e.
nc
ADD AL, 2 ; Increment AL by 2
ie
MOV [SI], AL ; Store the result back to the same memory location
sc
ng
MOV AH, 09h ; DOS function to display a string
5
ht
END
Screenshots of Output:
Learning Science | https://learningscience.co.in
.in
co
e.
nc
ie
sc
ng
ni
ar
(b) Write and run a program using 8086 assembly language which finds the highest of four byte values stored in memory. The highest value should be
e
left in AL register.
//l
Solution:
s:
ORG 100h ; Origin of the program, typically 100h for .COM programs
tp
.in
MOV BL, [SI+1] ; Load the second value into BL register
co
CMP BL, AL ; Compare BL with AL
e.
nc
MOV AL, BL ; Move BL to AL if BL is greater
ie
compare_next:
sc
MOV BL, [SI+2] ; Load the third value into BL register
ng
CMP BL, AL ; Compare BL with AL
compare_last:
//l
co
ADD AL, '0' ; Convert AL to ASCII
e.
INT 21h ; Call DOS interrupt
nc
MOV AH, 4Ch ; DOS function to terminate the program
ie
INT 21h ; Call DOS interrupt
sc
ng
RET ; Return from the program
END
ni
ar
Screenshots of Output:
e
//l
s:
tp
8
ht
clears BL register otherwise it clears AL register. You can move value '1100 1010' in AL, register and '1100 1000' in BL register, initially.
//l
Solution:
s:
.model small
tp
.stack 100h
9
ht
.data
.in
value_bl db 0C8h ; Value '1100 1000' in BL register
co
.code
main proc
e.
mov ax, @data
nc
mov ds, ax ; Set the data segment
ie
mov al, value_al ; Load value '1100 1010' into AL register
sc
mov bl, value_bl ; Load value '1100 1000' into BL register
ng
cmp al, bl ; Compare the values of AL and BL
ni
ar
jg clear_bl ; Jump to clear_bl if AL is greater than BL
e
; Clear AL register
//l
xor al, al
s:
jmp done
tp
10
ht
clear_bl:
; Clear BL register
.in
done:
co
mov ah, 4Ch ; Exit program
int 21h
e.
main endp
nc
end main
ie
Screenshots of Output:
sc
ng
ni
e ar
//l
s:
tp
11
ht
12
ht
sc
ng
Learning Science
https://learningscience.co.in
ni
ar
Thank You
e
//l
s:
tp
13
ht