0% found this document useful (0 votes)
34 views10 pages

MIC Project

The document describes a program to find the factorial of a given number in assembly language. It takes the number as input from a memory location, initializes the registers, and uses a loop to multiply the number by all integers down to 1, storing the result in register pairs. It then outputs the factorial to two memory locations.

Uploaded by

Sujal Sonawane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views10 pages

MIC Project

The document describes a program to find the factorial of a given number in assembly language. It takes the number as input from a memory location, initializes the registers, and uses a loop to multiply the number by all integers down to 1, storing the result in register pairs. It then outputs the factorial to two memory locations.

Uploaded by

Sujal Sonawane
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Department of Computer Science and Engineering

Shri Sai Institute of Technology, Aurangabad


(2023-2024)
Subject:- MIC
A Project Report
On
“Find Factorial Number”
Submitted by :-
Sujal Sonawane{2215420044}
Yash Puse {2215420055}
Rohit Badak {2215420114},
Arya Kundalwal{2215240068}
Mayank Kulkarni{2215420058}.

In partial fulfilment for the award of


Diploma in
Computer Science and Engineering
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION (MSBTE), MUMBAI, INDIA

CERTIFICATE
This is certified that, the project report entitled “Find Factorial Number ” Submitted
by Sujal Sonawane{2215420044} ,Yash Puse {2215420055},Rohit Badak
{2215420114},Arya Kundalwal{2215240068},Mayank Kulkarni{2215420058}. Has
completed as per the requirement of Maharashtra State Board of Technical
Education in partial fulfilment of Diploma in Computer Science and Engineering.

Place: Chatrapati sambhajinagar


Data: / /

Prof. Gaikwad V.M. Sign Sign


HOD-CW External Examiner Subject Teacher
Prof. Mr. P.S. TAYDE
Principal

Shri Sai Institute of Technology (Polytechnic),


Aurangabad

DECLARATION

We hereby declare that we have performed, completed and written the project
entitled “Find Factorial Number”. It has not previously submitted for the basis of
the award of any other degree or diploma or other similar title of his for any other
diploma/examining body or university to the best of knowledge and belief.

Place: Chatrapati sambhajinagar


Date: / /

Sujal Sonawane{2215420044}
,Yash Puse {2215420055},
Rohit Badak {2215420114},
AryaKundalwal{2215240068}
Mayank Kulkarni{2215420058}.
INDEX
Sr. No. Content Page no.
1 Introduction
2 Description
3 Procedure
4 Program
5 Output
Introduction

the year 1677, Fabian Stedman, a British author, defined factorial as an equivalent
ofchange ringing. Change ringing was a part of the musical performance where
themusicians would ring multiple tuned bells. And it was in the year 1808, when
amathematician from France, Christian Kramp, came up with the symbol for
factorial: n!The study of factorials is at the root of several topics in mathematics,
such as the numbertheory, algebra, geometry, probability, statistics, graph theory,
and discrete mathematics,etc.The factorial, symbolized by an exclamation mark (!),
is a quantity defined for all integers greater than or equal to 0.For an integer n
greater than or equal to 1, the factorial is the product of all integers lessthan or
equal to n but greater than or equal to 1. The factorial value of 0 is defined asequal
to 1. The factorial values for negative integers are not defined.Mathematically, the
formula for the factorial is as follows. If n is an integer greater thanor equal to 1,
thenn ! = n ( n - 1)( n - 2)( n - 3) ... (3)(2)(1)If p = 0, then p ! = 1 by convention.The
factorial is of interest to number theorists. It often arises in probability calculations,
particularly those involving combinations and permutations. The factorial also
arisesoccasionally in calculus and physics.1.0 `Aim of the Micro-Project:1. To solve
the given objective, we have taken a hexadecimal number in memorylocation of
0200H and multiplied it successively to obtain factorial.2. To Learn Program to find
the factorial of a number.
Description
A factorials is a funciton that multiplies a number by every number below
it. For example,
5!=5*4*3*2*1=120 the function si used , among other things to find the
number of way “n” objects can be arranged.
Factorials
There is n! Ways of arranging n distinct objects into an orderd
sequence. N the set of population in mathematics ther are n! Ways to
arrange n object in sequence.”The factorialn! Gives the number of ways
in whiche n objects can be pemuted.”
The factorial function (symbol:!) says to multiply all whole numbers form
our chosen number down to 1.
so the rule is:
n!=n*(n-1)!
Which says,
“the factorial of any number is that no times the factorial of (that
numbermins)”
one area they used in combinations and Permutations
Procedure:

*Problem statement:
write an assembly language program for calculating the factorical of a
number using 8086 microprocessors.
*Assumptions:
Starting address of program:0400
Input memory location :0500
Output memory location: 0600 and 0601
*Point to be noted:
if the given number is a 16 bit number the AX register is automatically
used as the seconde parameter and the product is stored in the DX:AX
register pair. This measns that the DX register holds the high part and
the AX register holds the low part of a 32 bit number.

*Algorithm:
1. Input the number whose factorial is to be find and store that
number in CX Register(condition for Loop instruction)
2. insert 0001 in AX (conditon for mul instruction) and 0000 in DX
3. Multipy CX with AX until CX become Zero(0) using Loop
instruction
4. copy the content fo AX to memory location 0600
5. Copy the content of DX to memory location 0601
6. Stop execution
Flowchart
Program

ADDRESS MNEMONICS COMMENTS

O400 MOV CX,[0500] CX <-[0500]

O404 MOV AX,0001 AX<-[0001]

O407 MOV DX, 0001 DX<-0000

O40A MUL CX DX:AX<-AX*CX

O40C LOOP 040A Go To [040A]till CX->00

O410 MOV[0600],AX [0600]<-AX

O414 MOV[0601],DX [0601]<-DX

O418 HLT Stop Execution


Output

You might also like