Co 3
Co 3
M
achine Language
Needs of Machine Language
As a human, we write code in high level language. The
programming language which we use to write codes such as C,
C++ and java are high level languages. High level language is not
understood by computer directly so it is converted into low level
machine language to understand the meaning of code and
perform execution. Computers compile the code written by us and
translate into machine code and then execute it. Computers are
only able to understand machine language.
Features of Machine Language
Below are some feature of Machine Language.
Machine language is a low level language.
Machine language consist of only 0 and 1 bits.
Machine languages are platform dependent.
It is nearly impossible to learn machine language for humans
because it requires a lot of memoization.
Machine language is used to create and construct drivers as
well.
Understand the Complexity of Machine
language
In machine language every character, integer and special
symbols are written in form of 0 and 1 . To understand machine
language let's take an example of a machine language
instruction. This is a simple addition operation: 01100110
00001010. This binary sequence represents an instruction that
tells the computer to add two numbers together.
Meaning of Binary bits in Machine Language:
A sequence of bits is used to give commands in machine
languages.
The 1s (one) represents the true or on states.
On the other hand, the 0s (zero) represent the off or false
states.
That's why no human can remember the binary codes of
machine languages. As a result, learning these languages is
not possible for humans.
Machine Language Instruction Components
Machine language consist of two instruction components :
1. Operand(s)
The operand(s) represents the data that the operation must be
performed on. This data can take various forms, depending on the
processor's architecture. This can be a register containing a
value, a memory address pointing to a location in memory where
the data is stored, or a constant value embedded within the
instruction itself.
2. Opcode
The opcode (Operation code) represents the operation that the
processor must perform. This indicate that the instruction is an
arithmetic operation such as addition, subtraction, multiplication,
or division.
Advantages of Machine Language
Some advantages of machine language are listed below:
Machine languages are faster in execution because they are in
binary form.
Machine language does not need to be translated , because it
is already present in simple binary form.
The CPU directly executes the machine language.
The evolution of the computer system and operating system
over the time period is due to machine language.
Machine languages are used in developing a high-grade
computer system.
Disadvantages of Machine Language
Some disadvantages of machine language are listed below:
Machine language are complex to understand and memorize.
Writing codes in machine language is time-consuming.
It is very difficult to resolve bugs and errors present in the
codes and programs.
Codes written in machine languages are more prone to error.
Machine languages are not easy to modify.
Machine language are platform Independent.
assembler in computer
An assembler is a computer program that translates assembly language
into machine code. This allows a computer's central processing unit (CPU)
to execute instructions written in assembly language.
How does an assembler work?
An assembler converts human-readable instructions into binary code.
It translates combinations of mnemonics and syntax into numerical
equivalents.
It calculates constant expressions and resolves symbolic names for
memory locations.
It assembles and converts assembly language source code into object
code.
Why use an assembler?
Assemblers are used for low-level programming.
They are specific to a particular computer architecture.
They give programmers direct control over the CPU and memory.
They allow programmers to optimize how the machine performs tasks.
Types of assemblers
Single-pass assemblers complete their work in one scan.
Multiple-pass assemblers complete their work in multiple scans.
Assembler vs. compiler
Assemblers are similar to compilers in that they produce executable
code. However, assemblers are simpler because they only convert low-
level code.
Introduction of ALU and Data Path
Representing and storing numbers were the basic operations of
the computers of earlier times. The real go came when
computation, manipulating numbers like adding and multiplying
came into the picture. These operations are handled by the
computer’s arithmetic logic unit (ALU). The ALU is the
mathematical brain of a computer. The first ALU (Arithmetic Logic
Unit) was indeed the INTEL 74181, which was implemented as
part of the 7400 series TTL (Transistor-Transistor Logic)
integrated circuits. It was released by Intel in 1970.
What is ALU?
ALU is a digital circuit that provides arithmetic and logic
operations. It is the fundamental building block of the central
processing unit of a computer. A modern central processing
unit(CPU) has a very powerful ALU and it is complex in design. In
addition to ALU modern CPU contains a control unit and a set of
registers. Most of the operations are performed by one or more
ALUs, which load data from the input register. Registers are a
small amount of storage available to the CPU. These registers can
be accessed very fast. The control unit tells ALU what operation to
perform on the available data. After calculation/manipulation, the
ALU stores the output in an output register.
The CPU can be divided into two sections: the data section and
the control section. The data section is also known as the data
path.
An Arithmetic Logic Unit (ALU) is a key component of the CPU
responsible for performing arithmetic and logical operations. The
collection of functional units like ALUs, registers, and buses that
move data within the processor. together are known as Data Path,
they execute instructions and manipulate data during processing
tasks.
BUS
In early computers BUS were parallel electrical wires with multiple
hardware connections. Therefore a bus is a communication
system that transfers data between components inside a
computer, or between computers. It includes hardware
components like wires, optical fibers, etc and software, including
communication protocols. The Registers, ALU, and the
interconnecting BUS are collectively referred to as data paths.
Types of the bus
There are mainly three type of bus:-
1. Address bus: Transfers memory addresses from the processor
to components like storage and input/output devices. It’s one-
way communication.
2. Data bus: carries the data between the processor and other
components. The data bus is bidirectional.
3. Control bus: carries control signals from the processor to
other components. The control bus also carries the clock’s
pulses. The control bus is unidirectional.
The bus can be dedicated, i.e., it can be used for a single purpose
or it can be multiplexed, i.e., it can be used for multiple purposes.
when we would have different kinds of buses, different types of
bus organizations will take place.
Registers
In Computer Architecture, the Registers are very fast computer
memory which is used to execute programs and operations
efficiently. but In that scenario, registers serve as gates, sending
signals to various components to carry out little tasks. Register
signals are directed by the control unit, which also operates the
registers.
The following list of five registers for in-out signal data storage:
1. Program Counter
A program counter (PC) is a CPU register in the computer
processor which has the address of the next instruction to be
executed from memory . As each instruction gets fetched, the
program counter increases its stored value by 1. It is a digital
counter needed for faster execution of tasks as well as for
tracking the current execution point.
2. Instruction Register
In computing, an instruction register (IR) is the part of a CPU’s
control unit that holds the instruction currently being executed
or decoded. The instruction register specifically holds the
instruction and provides it to the instruction decoder circuit.
3. Memory Address Register
The Memory Address Register (MAR) is the CPU register that
either stores the memory address from which data will be
fetched from the CPU, or the address to which data will be sent
and stored. It is a temporary storage component in the
CPU(central processing unit) that temporarily stores the
address (location) of the data sent by the memory unit until the
instruction for the particular data is executed.
4. Memory Data Register
The memory data register (MDR) is the register in a computer’s
processor, or central processing unit, CPU, that stores the data
being transferred to and from the immediate access storage.
Memory data register (MDR) is also known as memory buffer
register (MBR).
5. General Purpose Register
General-purpose registers are used to store temporary data
within the microprocessor . It is a multipurpose register. They
can be used either by a programmer or by a user.
What is Data Path?
Suppose that the CPU needs to carry out any data processing
action, such as copying data from memory to a register and vice
versa, moving register content from one register to another, or
adding two numbers in the ALU. Therefore, whenever a data
processing action takes place in the CPU, the data involved for
that operation follows a particular path, or data path.
Data paths are made up of various functional components, such
as multipliers or arithmetic logic units. Data path is required to do
data processing operations.
One Bus Organization
What is a Subroutine?
A set of instructions that are used repeatedly in a program can
be referred to as a Subroutine. Only one copy of this Instruction is
stored in the memory. When a Subroutine is required it can be
called many times during the Execution of a particular program. A
call Subroutine Instruction calls the Subroutine. Care Should be
taken while returning a Subroutine as a Subroutine can be called
from a different place from the memory.
The content of the PC must be Saved by the call Subroutine
Instruction to make a correct return to the calling program.
Disadvantages of Subroutines
address sequencing
In the context of computer architecture, address sequencing refers to the
process of generating a sequence of memory addresses to control the
execution of instructions. This is a fundamental aspect of how computers
access and process data efficiently.
Here's a more detailed explanation:
Purpose:
Address sequencing ensures that instructions and data are accessed in
the correct order, enabling the CPU to execute programs correctly.
Methods:
Incrementing: The simplest method is to increment the current address to
fetch the next instruction in sequential memory locations.
Branching: Instructions can use branching (conditional or unconditional) to
jump to different memory addresses, altering the execution flow.
Mapping: Instruction codes can be mapped to specific routines in control
memory, which are then executed.
Microprogrammed Control:
In microprogrammed control units, address sequencing becomes crucial
for controlling the execution of micro-instructions, which are stored in
groups within control memory, each representing a specific routine.
Control Unit's Role:
The control unit (or CPU's control part) uses address sequencing to
initiate sequences of micro-operations.
Examples of Address Sequencing in Computer Architecture
Incrementing CAR: The hardware controlling the address sequencing of the
control memory must be capable of incrementing the control address register
(CAR), moving to the next microinstruction address.
Branching: Unconditional or conditional branching based on status bits
allows the control unit to jump to different routines or microinstructions.
Input-Output Interface
In micro-computer base system, the only purpose of peripheral
devices is just to provide special communication links for the
interfacing them with the CPU. To resolve the differences between
peripheral devices and CPU, there is a special need for
communication links.
The major differences are as follows:
1. The nature of peripheral devices is electromagnetic and
electro-mechanical. The nature of the CPU is electronic. There
is a lot of difference in the mode of operation of both peripheral
devices and CPU.
2. There is also a synchronization mechanism because the data
transfer rate of peripheral devices are slow than CPU.
3. In peripheral devices, data code and formats are differ from the
format in the CPU and memory.
4. The operating mode of peripheral devices are different and
each may be controlled so as not to disturb the operation of
other peripheral devices connected to CPU.
There is a special need of the additional hardware to resolve the
differences between CPU and peripheral devices to supervise and
synchronize all input and output devices.
Functions of Input-Output Interface:
1. It is used to synchronize the operating speed of CPU with
respect to input-output devices.
2. It selects the input-output device which is appropriate for the
interpretation of the input-output signal.
3. It is capable of providing signals like control and timing signals.
4. In this data buffering can be possible through data bus.
5. There are various error detectors.
6. It converts serial data into parallel data and vice-versa.
7. It also convert digital data into analog signal and vice-versa.
Disadvantages:
Cost: I/O interfaces can be expensive, especially if specialized
hardware is required to connect a particular device to a computer
system.
Complexity: Some I/O interfaces can be complex to configure
and require specialized knowledge to set up and maintain. This
can be a disadvantage for users who are not familiar with the
technical aspects of computer hardware.
Compatibility issues: While I/O interfaces are designed to be
compatible with a wide range of devices, there can still be
compatibility issues with certain devices. In some cases, device
drivers may need to be installed to ensure proper functionality.
Security risks: I/O interfaces can be a security risk if they are
not properly configured or secured. Hackers can exploit
vulnerabilities in I/O interfaces to gain unauthorized access to a
computer system or steal data.
2. Output Devices:
An output device is generally the reverse of the input process and
generally translates the digitized signals into a form intelligible to
the user. The output device is also performed for sending data
from one computer system to another. For some time punched
card and paper tape readers were extensively used for input, but
these have now been supplanted by more efficient devices.
Example:
Monitors, headphones, printers etc.
3. Storage Devices:
Storage devices are used to store data in the system which is
required for performing any operation in the system. The storage
device is one of the most required devices and also provides
better compatibility. Example:
Hard disk, magnetic tape, Flash memory etc.
4. Communication Devices:
Communication devices are used to connect a computer system to
other devices or networks. Examples of communication devices
include:
Introduction to Input-Output
Interface
Input-Output Interface is used as a method which helps in transferring of
information between the internal storage devices i.e. memory and the
external peripheral device . A peripheral device is that which provide input
and output for the computer, it is also called Input-Output devices. For
Example: A keyboard and mouse provide Input to the computer are called
input devices while a monitor and printer that provide output to the
computer are called output devices. Just like the external hard-drives,
there is also availability of some peripheral devices which are able to
provide both input and output.
Input-Output Interface
In micro-computer base system, the only purpose of peripheral devices is
just to provide special communication links for the interfacing them with
the CPU. To resolve the differences between peripheral devices and CPU,
there is a special need for communication links.
The major differences are as follows:
1. The nature of peripheral devices is electromagnetic and electro-
mechanical. The nature of the CPU is electronic. There is a lot of
difference in the mode of operation of both peripheral devices and
CPU.
2. There is also a synchronization mechanism because the data transfer
rate of peripheral devices are slow than CPU.
3. In peripheral devices, data code and formats are differ from the format
in the CPU and memory.
4. The operating mode of peripheral devices are different and each may
be controlled so as not to disturb the operation of other peripheral
devices connected to CPU.
There is a special need of the additional hardware to resolve the
differences between CPU and peripheral devices to supervise and
synchronize all input and output devices.
Functions of Input-Output Interface:
1. It is used to synchronize the operating speed of CPU with respect to
input-output devices.
2. It selects the input-output device which is appropriate for the
interpretation of the input-output signal.
3. It is capable of providing signals like control and timing signals.
4. In this data buffering can be possible through data bus.
5. There are various error detectors.
6. It converts serial data into parallel data and vice-versa.
7. It also convert digital data into analog signal and vice-versa.
Asynchronous Data Transfer
Last Updated : 24 Sep, 2023
2. They are more efficient than software polling as the processor does not
waste time constantly checking for events that have not occurred.
3. Priority interrupts are also more deterministic, as the response time to
an event can be accurately predicted based on its priority level.
Disadvantages:
1. One potential disadvantage of priority interrupts is the possibility of
lower priority tasks being starved of resources if high-priority tasks are
continuously interrupting the processor.
Software polling:
Advantages:
1. Software polling is relatively simple to implement and does not require
specialized hardware.
Disadvantages:
1. Software polling is less efficient than priority interrupts as the processor
must constantly check for events even if none have occurred.
Daisy chaining:
Advantages:
1. Daisy chaining allows multiple devices to share a single interrupt line,
reducing the number of interrupt lines required.
Disadvantages:
1. Daisy chaining can result in increased response time as each device
must wait for the previous device to complete its interrupt handling
before it can start its own.
2. It can also be difficult to implement and troubleshoot, especially if there
are multiple devices on the same interrupt line.
Input-Output Processor
The DMA mode of data transfer reduces the CPU’s overhead in
handling I/O operations. It also allows parallelism in CPU and I/O
operations. Such parallelism is necessary to avoid the wastage of
valuable CPU time while handling I/O devices whose speeds are
much slower as compared to CPU. The concept of DMA operation
can be extended to relieve the CPU further from getting involved
with the execution of I/O operations. This gives rise to the
development of special purpose processors called Input-Output
Processor (IOP) or IO channels.
The Input-Output Processor (IOP) is just like a CPU that handles
the details of I/O operations. It is more equipped with facilities
than those available in a typical DMA controller. The IOP can fetch
and execute its own instructions that are specifically designed to
characterize I/O transfers. In addition to the I/O-related tasks, it
can perform other processing tasks like arithmetic, logic,
branching, and code translation. The main memory unit takes a
pivotal role. It communicates with the processor by means of
DMA.
The Input-Output Processor is a specialized processor which loads
and stores data in memory along with the execution of I/O
instructions. It acts as an interface between the system and
devices. It involves a sequence of events to execute I/O
operations and then store the results in memory.
Input-Output Processor
Simplex
Components
1. Sender/Transmitter: The device or module responsible for
sending the data.
2. Receiver: The device or module that receives and processes
the data.
3. Communication Medium: The physical or wireless medium
through which the data is transmitted, such as cables, fiber
optics, or radio waves.
Working of Simplex
The working of simplex type of communication is very easy to
understand that only one type of transmission happens that is
from sender to receiver. The reverse communication is not
possible, only the sender alone can send the messages to
receiver. The receiver only can read it but their no possibility of
reverse communication in these type of communication.
Half Duplex
This mode uses a single communication channel for both
transmission and reception, but not simultaneously. Devices must
take turns to send and receive data. Lets see the diagram how
Half Duplex works.
Half Duplex SCI
Components
1. Sender/Transmitter: The device or module responsible for
sending the data.
2. Receiver: The device or module that receives and processes
the data.
3. Communication Medium: The physical or wireless medium
through which the data is transmitted, such as cables, fiber
optics, or radio waves.
Working of Half Duplex
The working of half duplex involves both side communication but
not simultaneously. That means if sender sends the message to
receiver than after the the message is successfully transmitted
only the receiver can send the return message to sender. In the
same way if receiver sends the message to sender than after the
the message is successfully transmitted only the sender can send
the return message to receiver.
Full Duplex
In this mode, data transmission and reception occur
simultaneously on separate channels, allowing continuous
bidirectional communication. Lets see the diagram how Full
Duplex works.