Module 1 Notes
Module 1 Notes
Input Unit :The input unit consists of input devices that are attached to the computer.
These devices take input and convert it into binary language that the computer understands.
Some of the common input devices are keyboard, mouse, joystick, scanner etc.
Central Processing Unit (CPU) : Once the information is entered into the computer by
the input device, the processor processes it. The CPU is called the brain of the computer
because it is the control center of the computer. It first fetches instructions from memory
and then interprets them so as to know what is to be done. If required, data is fetched from
memory or input device. Thereafter CPU executes or performs the required computation
and then either stores the output or displays on the output device. The CPU has three main
components which are responsible for different functions – Arithmetic Logic Unit (ALU),
Control Unit (CU) and Memory registers
Arithmetic and Logic Unit (ALU) : The ALU, as its name suggests performs
mathematical calculations and takes logical decisions. Arithmetic calculations include
addition, subtraction, multiplication and division. Logical decisions involve comparison of
two data items to see which one is larger or smaller or equal.
Control Unit : The Control unit coordinates and controls the data flow in and out of CPU
and also controls all the operations of ALU, memory registers and also input/output units.
It is also responsible for carrying out all the instructions stored in the program. It decodes
the fetched instruction, interprets it and sends control signals to input/output devices until
the required operation is done properly by ALU and memory.
Memory Registers : A register is a temporary unit of memory in the CPU. These are used
to store the data which is directly used by the processor. Registers can be of different
sizes(16 bit, 32 bit, 64 bit and so on) and each register inside the CPU has a specific
function like storing data, storing an instruction, storing address of a location in memory
etc. The user registers can be used by an assembly language programmer for storing
operands, intermediate results etc. Accumulator (ACC) is the main register in the ALU and
contains one of the operands of an operation to be performed in the ALU.
Memory : Memory attached to the CPU is used for storage of data and instructions and is
called internal memory The internal memory is divided into many storage locations, each
of which can store data or instructions. Each memory location is of the same size and has
an address. With the help of the address, the computer can read any memory location easily
without having to search the entire memory. when a program is executed, it’s data is copied
to the internal memory and is stored in the memory till the end of the execution. The
internal memory is also called the Primary memory or Main memory. This memory is also
called as RAM, i.e. Random Access Memory. The time of access of data is independent of
its location in memory, therefore this memory is also called Random Access memory
(RAM).
Output Unit : The output unit consists of output devices that are attached with the
computer. It converts the binary data coming from CPU to human understandable form.
The common output devices are monitor, printer, plotter etc.
Random Access Memory (RAM) and Read Only Memory (ROM)
It is also called read-write memory or the main memory or the primary memory.
The programs and data that the CPU requires during the execution of a program are stored in this
memory.
It is a volatile memory as the data is lost when the power is turned off.
RAM is further classified into two types- SRAM (Static Random Access Memory) and DRAM
(Dynamic Random Access Memory).
Difference between DRAM and SRAM
Stores crucial information essential to operate the system, like the program essential to boot the
computer.
It is not volatile.
Always retains its data.
Used in embedded systems or where the programming needs no change.
Used in calculators and peripheral devices.
ROM is further classified into four types- MROM, PROM, EPROM, and EEPROM.
RAM(Random Access Memory) is a part of computer’s Main Memory which is directly accessible
by CPU. RAM is used to Read and Write data into it which is accessed by CPU randomly. RAM
is volatile in nature, it means if the power goes off, the stored information is lost. RAM is used to
store the data that is currently processed by the CPU. Most of the programs and data that are
modifiable are stored in RAM.
1. SRAM(Static RAM)
2. DRAM(Dynamic RAM)
1.SRAM :
The SRAM memories consist of circuits capable of retaining the stored information as long as
the power is applied. That means this type of memory requires constant power. SRAM
memories are used to build Cache Memory.
SRAM Memory Cell: Static memories(SRAM) are memories that consist of circuits
capable of retaining their state as long as power is on. Thus this type of memory is called
volatile memory.Two transistors T1 and T2 are used for connecting the latch with two-bit
lines. The purpose of these transistors is to act as switches that can be opened or closed
under the control of the word line, which is controlled by the address decoder. When the
word line is at 0-level, the transistors are turned off and the latch remains its information.
For example, the cell is at state 1 if the logic value at point A is 1 and at point, B is 0. This
state is retained as long as the word line is not activated.
For Read operation, the word line is activated by the address input to the address
decoder. The activated word line closes both the transistors (switches) T1 and T2. Then
the bit values at points A and B can transmit to their respective bit lines. The sense/write
circuit at the end of the bit lines sends the output to the processor.
For Write operation, the address provided to the decoder activates the word line to close
both the switches. Then the bit value that is to be written into the cell is provided through
the sense/write circuit and the signals in bit lines are then stored in the cell.
2.DRAM :
DRAM stores the binary information in the form of electric charges applied to capacitors. The
stored information on the capacitors tends to lose over a period of time and thus the capacitors
must be periodically recharged to retain their usage. The main memory is generally made up of
DRAM chips.
DRAM Memory Cell: Though SRAM is very fast, but it is expensive because of its every cell
requires several transistors. Relatively less expensive RAM is DRAM, due to the use of one
transistor and one capacitor in each cell, as shown in the below figure., where C is the capacitor
and T is the transistor. Information is stored in a DRAM cell in the form of a charge on a
capacitor and this charge needs to be periodically recharged.
For storing information in this cell, transistor
For storing information in this cell, transistor T is turned on and an appropriate voltage is
applied to the bit line. This causes a known amount of charge to be stored in the capacitor.
After the transistor is turned off, due to the property of the capacitor, it starts to discharge.
Hence, the information stored in the cell can be read correctly only if it is read before the
charge on the capacitors drops below some threshold value.
Types of DRAM :
There are mainly 5 types of DRAM:
However, a computer does not understand high-level language. It only understands the program
written in 0's and 1's in binary, called the machine code.
To convert source code into machine code, we use either a compiler or an interpreter.
Both compilers and interpreters are used to convert a program written in a high-level language into
machine code understood by computers. However, there are differences between how an
interpreter and a compiler works.
High level and low level languages
Programming languages define and compile a set of instructions for the CPU (Central Processing Unit) for
performing any specific task. Every programming language has a set of keywords along with syntax- that
it uses for creating instructions. A few of these languages provide less or no abstraction at all, while the
others provide a very high abstraction. On the basis of this level of abstraction, there are two types of
programming languages:
Low-level language
High-level language
Most programming languages that you will have heard of are high-level languages. Python and C#
are examples of high-level languages that are widely used in education and in the workplace. A
high-level language is one that is user-oriented in that it has been designed to make it
straightforward for a programmer to convert an algorithm into program code.
Algorithm
Flowchart