You are on page 1of 36

Machine Organization and

Microprocessor

Rohit Majumder
Roll No. 33
PRN: 2043110144
CSE, Navi Mumbai
Professor: Ahmer Usmani

Index
Sr. No. Contents
1 Case study on budget for building of your own computer
2 Case study on I/O Ports
3 Study and verify the truth table of all logic gates
4 Design a Half Adder and Full Adder using basic gates.
5 WAP to display ‘Hello world’ using ALP
6 WAP to perform addition to two 8bits number using ALP
7 WAP to multiply two 8-bit number using ALP
8 WAP to set, clear and flip of bit in each number using logical
operation
9 WAP to count the number of 1’s in an 8-bit number using ALP
10 WAP to transfer a block of data from one place to another using
string instruction
11 Assignment 1
12 Assignment 2
13 Assignment 3
14 Assignment 4
15 Assignment 5
16 Assignment 6

Experiment 1
Aim: To study the parts of computer system. Built your own computer and find out
the overall budget of your PC.

Theory: To understand the actual working of computer system we must have an idea
of the parts that makes a computer.
A modern computer may contain hundreds of different controllers and chips,
but even the most complicated of machines can be boiled down to a few simple
parts. Understanding just these parts can give you an excellent idea of how a
computer operates.
Following are some of the essential components / parts of a computer.
1. Motherboard:

The motherboard is the main circuit board that all other computer
components either sit in or are connected to. A motherboard (sometimes
alternatively known as the main circuit board, system board, baseboard, planar
board, or logic board is the main printed circuit board (PCB) found in general
purpose micro-computers and other expandable systems. All the functions of
computer depend on the motherboard. The motherboard type will determine what
kind of processor and memory chips can be installed on the computer, along with
what kind of external connections, such as USB, are natively supported. Some
motherboards also will include onboard video and sound, removing the need for
expansion cards.

2. Processors/Central Processing Unit:

A central processing unit (CPU) is the electronic circuitry within a computer that
carries out the instructions of a computer program by performing the basic
arithmetic, logic, controlling, and input/output (I/O) operations specified by the
instructions. The processor is probably the most important internal part of your
computer, as it is where almost all the computations required to run the computer
take place. The processor sits inside of a small socket near the middle of the
motherboard, and on top of executing code for your programs, it also controls how
the other computer components communicate and operate. The processor's power
is measured in megahertz, and more recently gigahertz, with a higher number
representing more processing power.

3. Graphics Processing Unit /Video Card:


Graphics processing unit (GPU) is a specialized electronic circuit designed to rapidly
manipulate and alter memory to accelerate the creation of images in a frame buffer
intended for output to a display device. GPUs are used in embedded systems, mobile
phones, personal computers, workstations, and game consoles. While some older
motherboards have built-in video, most modern systems require a separate video
card to output graphics. The pure computational power required to render modern
graphics require a separate processor and cooling unit that is housed on this video
card. The card itself is connected to the motherboard using an expansion slot.

3. Storage Devices:
Primary / Main Memory:

Primary storage (also known as main memory or internal memory), often referred to
simply as memory, is the only one directly accessible to the CPU. The CPU
continuously reads instructions stored there and executes them as required. Any
data actively operated on is also stored there in uniform manner. It is a volatile
memory. Random-access memory (RAM) is a form of computer data storage that
stores data and machine code currently being used. A random-access memory
device allows data items to be read or written in almost the same amount of time
irrespective of the physical location of data inside the memory. When the processor
needs information for a program or task, it first loads that data into random access
memory. or RAM. RAM is short term memory, meaning that it gets wiped out every
time the computer loses power or gets reset, but its speed of access makes it ideal
for being the computer's primary storage. Secondary Memory Secondary storage
(also known as external memory or auxiliary storage) differs from primary storage in
that it is not directly accessible by the CPU. The computer usually uses its
input/output channels to access secondary storage and transfers the desired data
using intermediate area in primary storage. Secondary storage does not lose the
data when the device is powered down—it is non-volatile. e.g., Hard Disk Drives,
Solid State Drives, USB Pen-drive, Optical Disk Drive
Hard Drive:

A hard disk drive (HDD), hard disk, hard drive, or fixed disk, is an electromechanical
data storage device that uses magnetic storage to store and retrieve digital
information using one or more rigid rapidly rotating disks (platters) coated with
magnetic material. The platters are paired with magnetic heads, usually arranged on
a moving actuator arm, which read and write data to the platter surfaces. When the
processor needs a file or set of files to run a program, it copies them from the hard
drive and loads those copies into RAM. Hard drive capacities are measured in
gigabytes, or sometimes terabytes, with the larger numbers representing more
capacity.
4.Expansion Slots:

These slots sit near the back of the computer and allow you to install devices to
upgrade the system. These devices, which look like cards that slide into these slots,
can be used for audio, video, network capabilities, additional USB connections and
more. Some slots, like an AGP slot, are used exclusively for video cards, but most of
the slots on modern systems are generic PCI-X slots that are used for all cards.

5.Network Interface Controller:

A network interface controller (NIC, also known as a network interface card, network
adapter, LAN adapter or physical network interface, and by similar terms) is a
computer hardware component that connects a computer to a computer network.
Early network interface controllers were commonly implemented on expansion
cards that plugged into a computer bus. The low cost and ubiquity of the Ethernet
standard means that most newer computers have a network interface built into the
motherboard.

6. Power Supply:

The power supply is generally located in one corner of the back side of your
computer case. On the side that faces out of the computer it has a single plug for
your power cable and openings for the cooling fan. On the side that faces the inside
of the system it has a set of power wires that you use to supply power to all the
computer's internal devices. Some devices, like RAM or small expansion cards, get
enough power through the motherboard so they don't need a direct connection to
the power supply, but most other device does need to be plugged into one of these
wires to operate.
1. CPU:
AMP Risen 7 5800
Rs. 30000

2. Motherboard:
Asus Prime X570
Rs. 15000

3. RAM:
HyperX Fury DDR4 8*2 GB 3200MHz
Rs. 8000

4. SSD:
Western Digital Blue SN570 NV Me 1TB
Rs. 8000

5. GPU:
RTX 3060 8GB
Rs. 55000

6. PSU:
Cooler Master 750W 80+ Gold
Rs. 7000

7. Cabinet:
Ant Esports ICE-511MT Mid Tower
Rs. 4500

8. CPU Cooler:
DEEPCOOL GAMMAXX L240T
Rs. 4500

9. Monitor:
LG Ultra gear 27-inch
Rs. 25000

10. Keyboard:
Zebroids Zeb-MAX PRO
Rs. 3500

11. Mouse:
Logitech G502 Hero
Rs. 4000
12. Headphones:
HyperX Cloud Core
Rs. 5500

Total Price:
Rs. 170000/-

Conclusion: Thus, we have studied and understood different internal parts of a computer.
We have also evaluated the functions and their uses in a computer system.
Experiment 2

Aim: To study the different input and output ports of a computer.

Theory: A connection point that acts as interface between the computer and external
devices like mouse, printer, modem, etc. is called port. Ports are of two types –
Internal port − It connects the motherboard to internal devices like hard disk drive, CD drive,
internal modem, etc.
External port − It connects the motherboard to external devices like modem, mouse,
printer, flash drives, etc.
The word “port” is used often in the computer industry and has many different meanings
depending on what technology is being referred to. In this section, we detail input/output
(I/O) ports. I/O ports allow for connections to hardware. This hardware could be internal or
external. The ports are associated with copper circuits and memory ranges that
allow the communication of data between the CPU, RAM, and the ports themselves.
Common I/O ports include USB and FireWire. In this section, we also discuss SCSI, audio
connections, MIDI, and RG-6 coaxial ports. Although the most important I/O port on recent
systems is the USB port, you might also encounter other ports, including legacy ports such
as serial and parallel, which we speak to in this section as well.
The word “port” is used often in the computer industry and has many different meanings
depending on what technology is being referred to. In this section, we detail input/output
(I/O) ports. I/O ports allow for connections to hardware. This hardware could be internal or
external. The ports are associated with copper circuits and memory ranges that
allow the communication of data between the CPU, RAM, and the ports themselves.
Common I/O ports include USB and FireWire. In this section, we also discuss SCSI, audio
connections, MIDI, and RG-6 coaxial ports. Although the most important I/O port on recent
systems is the USB port, you might also encounter other ports, including legacy ports such
as serial and parallel, which we speak to in this section as well.
Serial Port:
Serial ports transmit data sequentially one bit at a time. So, they need only one wire to
transmit 8 bits. However, it also makes them slower. Serial ports are usually 9-pin or 25-pin
male connectors. They are also known as COM

(communication) ports or RS323C ports

Parallel Port:
Parallel ports can send or receive 8 bits or 1 byte at a time. Parallel ports come in form of
25-pin female pins and are used to connect printer, scanner, external hard disk drive, etc.

USB Port:
USB stands for Universal Serial Bus. It is the industry standard for short distance digital data
connection. USB port is a standardized port to connect a variety of devices like printer,
camera, keyboard, speaker, etc.
PS-2 Port:
PS/2 stands for Personal System/2. It is a female 6-pin port standard that connects to the
male mini-DIN cable. PS/2 was introduced by IBM to connect mouse and keyboard to
personal computers. This port is now mostly obsolete, though some systems compatible
with IBM may have this port.

Infrared Port:
Infrared port is a port that enables wireless exchange of data within a radius of 10m. Two
devices that have infrared ports are placed facing each other so that beams of infrared lights
can be used to share data.
Bluetooth Port:
Bluetooth is a telecommunication specification that facilitates wireless connection between
phones, computers, and other digital devices over short-range wireless connection.
Bluetooth port enables synchronization between Bluetooth-enabled devices. There are two
types of Bluetooth ports –
•Incoming− It is used to receive connection from Bluetooth devices.
•Outgoing− It is used to request connection to other Bluetooth devices.

Fire Wire Port Fire


Wire is Apple Computer’s interface standard for enabling high speed communication using
serial bus. It is also called IEEE 1394 and used mostly for audio and video devices like digital
camcorders.
Display Port:
DisplayPort (DP) is a digital display interface developed by a consortium of PC and chip
manufacturers and standardized by the Video Electronics Standards Association (VESA). The
interface is primarily used to connect a video source to a display device such as a computer
monitor, and it can also carry audio, USB, and other forms of data.[2] DisplayPort was
designed to replace VGA, DVI, and FPD-Link. The interface is backward compatible with
other interfaces, such as HDMI and DVI, through the use of either active or passive adapters.
SCSI:
Small Computer System Interface is a set of standards for physically connecting and
transferring data between computers and peripheral devices. The SCSI standards define
commands, protocols, electrical, optical, and logical interfaces. SCSI is most used for hard
disk drives and tape drives, but it can connect a wide range of other devices, including
scanners and CD drives, although not all controllers can handle all devices. The SCSI
standard defines command sets for specific peripheral device types; the presence of
"unknown" as one of these types means that in theory it can be used as an interface to
almost any device, but the standard is highly pragmatic and addressed toward commercial
requirements.

DE-9:
A D-sub contains two or more parallel rows of pins or sockets usually surrounded by a D-
shaped metal shield that provides mechanical support, ensures correct orientation, and may
screen against electromagnetic interference. The part containing pin contacts is called the
male connector plug, while that containing socket contacts is called the female connector
socket. The socket’s shield fits tightly inside the plug’s shield. Panel mounted connectors
usually have threaded nuts that accept screws on the cable end connector cover that are
used for locking the connectors together and offering mechanical strain relief. Occasionally
the nuts may be found on a cable end connector if it is expected to connect to another cable
end (see the male DE-9 pictured). When screened cables are used, the shields are
connected to the overall screens of the cables. This creates an electrically continuous screen
covering the whole cable and connector system

Conclusion: Thus, we have studied input/output ports


Experiment 3

Aim: Study and verify the truth table of all logic gates (Basic and Universal).

Theory:

1) Basic Gates:
Logic Gates are the basic building blocks of any digital system. It is an electronic
circuit having one or more than one input and only one output. The relationships are
named as AND gate, OR gate, NOT gate etc.
AND Gate:
A circuit which performs an AND operation is shown figure below and verifying the
truth table, between the input and the output is based on a certain logic. Based on
this, logic gates
i. A= 0 AND B= 0
ii. A= 0 AND B= 1
iii. A= 1 AND B= 0
iv. A= 1 AND B= 1
OR gate:
A circuit which performs an OR operation is shown in figure below and verifying the
truth table below,
i. A= 0 OR B= 0
ii. A= 0 OR B= 1
iii. A= 1 OR B= 0
iv. A= 1 OR B= 1
NOT gate:
NOT gate is also known as Inverter. It has one input A, and one output B is shown in
figures and verifying the truth table below,
i. A= 0
ii. A= 1

2) Universal Gates:
A universal gate is a gate which can implement any Boolean function without need
to use any other gate type. The NAND and NOR gates are universal gates.
NAND gate:
NAND gate represents the complement of the AND operation. A NOT-AND operation
is known as NAND operation. The figures of NAND are shown and verifying the truth
table below,
i. A= 0 NAND B= 0
ii. A= 0 NAND B= 1
iii. A= 1 NAND B= 0
iv. A= 1 NAND B= 1
NOR gate:
NOR gate represents the complement of the OR operation. A NOT-OR operation is
known as NOR operation. The figures of NOR is shown and verifying the truth table
below,
i. A= 0 NOR B= 0
ii. A=0 NOR B= 1
iii. A= 1 NOR B= 0
iv. A= 1 NOR B= 1

Conclusion: Therefore, we have studied and verified the logic gate i.e., basic gate and
universal gate.
Experiment 4

Aim: Design a Half Adder and Full Adder using basic gates.

Theory:
1) Half Adder (HA):
The addition of 2 bits is done using a combination circuit called half adder (HA). Input
variables are augend and addend bits, and output variables are sum and carry bits. A
and B are the two input bits.

2) Full Adder (FA):


It is the adder which adds three inputs and produces two outputs. The first two inputs
are A and B, and the third input is an input carry as C-IN. The output carry is designated
as C-OUT and the normal output is designated as S which is SUM.

Conclusion: Therefore, we have successfully and working statement of half adder and
full adder.
Experiment 5

Aim: Write a program to display hello world using ALP.

Code:

Output:
Conclusion: Thus, we have successfully executed program to display hello world using ALP.
Experiment 6

Aim: Write a program to perform addition of two 8-bit numbers using ALP.

Code:
Output:

Conclusion: Thus, we have successfully written a program to perform addition of two 8-bit
numbers using ALP.
Experiment 7

Aim: Write a program to perform multiplication of two 8-bit numbers using ALP.

Program Code:
data segment a db 09h b
db 02h c dw? data ends
code segment assume
cs:code, ds:data
start: mov ax, data mov ds, ax mov ax, 0000h mov bx, 0000h mov al, a mov bl, b mul bl mov
c, ax int 3 code ends end
start

Output:

Conclusion: Hence, we have successfully executed the program to multiply two 8-bit
numbers using ALP.
Experiment 8

Aim: Write a program to set, clear and flip of bit in a given number using logical operation.

Code:

1. To Set the Data


DATA SEGMENT
DATA ENDS

CODE SEGMENTASSUME
ds:DATA,cs:CODESTART:
MOV AX,DATA
MOV DX,AX
MOV BX,1234H
MOV CX,0FFFFH
OR BX,CX
MOV DX,BX

MOV AH,02H
INT 21H

MOV AH,4CH
INT 21H
CODE ENDS
END START
2. To Clear the Data
DATA SEGMENT
DATA ENDS
CODE SEGMENT ASSUME
ds:DATA;cs:CODE START:
MOV AX,DATA MOV
DX,AX
MOV BX,1234H
MOV CX,0000H
AND BX,CX
ADD BX,30H
MOV DX,BX

MOV AH,02H
INT 21H

MOV AH,4CH
INT 21H
CODE ENDS
END START
3. To Flip the Data
DATA SEGMENT
DATA ENDS
CODE SEGMENT ASSUME
ds:DATA; cs:CODESTART:
MOV AX, DATAMOV
DX, AX
MOV BX, 1234H
MOV CX, 0ffffh
XOR BX, CX
ADD BX, 00H
MOV DX, BX
MOV AH,02H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END START
Conclusion: Thus, we have successfully executed program to set, clear and flip of bit in a
given number using logical operation.
Experiment 9

Aim: Write a program to count the number of 1's in an 8-bit number using ALP.

Code:

Output:
Conclusion: Thus, we have successfully executed program to count the number of 1's in an
8-bit number using ALP.
Experiment 10

Aim: Write a program to transfer a block of data from one place to another using string
instruction.

Code:

Output:
Conclusion: Thus, we have successfully executed program to transfer a block of data from
one place to another using string instruction.

You might also like