Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assembly Language The general Fibonacci sequence is a sequence that starts with

ID: 3585459 • Letter: A

Question

Assembly Language

The general Fibonacci sequence is a sequence that starts with f0=0 and f1=1 . The next number in the sequence is the sum of previous two numbers. So the Fibonacci number sequence generated in our circuit will be: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89… Here is the circuit you may use. Please make an effort to understand the working of this circuit and explain it as comments in your HDL file. To use this circuit, you have to control these signals, namely, enable1, enable2, enable3 and msel. msel=0 will select the starting values f0 and f1 of the Fibonacci Sequence msel=1 will keep running the Fibonacci sequence with sum(t+1) sum(t) + sum(t-1) for clock cycle t enable1=1 or enable2=1 or enable3=1 activate respective registers by loading the corresponding input values to corresponding register outputs enable1=0 or enable2=0 or enable3=0 retain the register outputs from the previous cycle The test file Fibonacci.tst assigns the values to these control signals. See how output in the Fibonacci.out file changes while changing those signals.

base code:

CHIP Fibonacci {

IN f0[16], enable1, msel, enable2, enable3, f1[16];

OUT out[16];

PARTS:

//Put your code here

Explanation / Answer

Here are the code for fabinocci series for the generation of given numbers


.DATA
VAL1 DB 01H
VAL2 DB 01H
LP DB 00H
V1 DB 00H
V2 DB 00H
NL DB 0DH,0AH,'$'

.CODE

MAIN PROC
MOV AX,@DATA
MOV DS,AX

MOV AH,01H
INT 21H
MOV CL,AL
SUB CL,30H
SUB CL,2

MOV AH,02H
MOV DL,VAL1
ADD DL,30H
INT 21H

MOV AH,09H
LEA DX,NL
INT 21H

MOV AH,02H
MOV DL,VAL2
ADD DL,30H
INT 21H

MOV AH,09H
LEA DX,NL
INT 21H


DISP:
MOV BL,VAL1
ADD BL,VAL2

MOV AH,00H
MOV AL,BL
MOV LP,CL
MOV CL,10
DIV CL
MOV CL,LP

MOV V1,AL
MOV V2,AH

MOV DL,V1
ADD DL,30H
MOV AH,02H
INT 21H

MOV DL,V2
ADD DL,30H
MOV AH,02H
INT 21H

MOV DL,VAL2
MOV VAL1,DL
MOV VAL2,BL

MOV AH,09H
LEA DX,NL
INT 21H


LOOP DISP

MOV AH,4CH
INT 21H

MAIN ENDP
END MAIN

o/p: enter the no of fabinocii values to be printed 5
1 1 2 3 5  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote