0% found this document useful (0 votes)
44 views32 pages

Computer 1205 1

Uploaded by

murshedmur90
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)
44 views32 pages

Computer 1205 1

Uploaded by

murshedmur90
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/ 32

Basics to Computer Programing and SPSS (1205)

1. Define a computer. Describe the components of a computer system. Explain


functions of a computer.
Write about some application areas of computers.
Explain briefly about the generations of computers

2. What is CPU and what are the components of a CPU? Explain briefly.
Write a detailed explanation of the use of cache memory.
Draw the instruction fetch cycle of a computer system and explain each step.

3. Differentiate between primary and secondary memory.


Define pipelining and parallel processing.
What is micro processor? Explain functions of micro processor.
Write a comparative analysis on RISC and CISC

4. What is computer buss? Write about three type of system buses.


Explain about the memory hierarchy of a computer system with appropriate figure.
What is RAM? Differentiate between SRAM and DRAM

5. What is ROM? Classify ROM and write a brief description of each.


What is the functions of RAM and ROM? Differentiate between RAM and ROM.

6. Write short descriptions on EBCDIC, ASCII and UNICODE.


What is programing language? Classify and describe each type.
Differentiate between compiler and interpreter.
Define CPU scheduling. Describe three types of scheduling.

7. Numbers
Write short note on OMR and OCR
Keyboard and Monitor

Write short notes on: IP, DNS, URL, DDL, DML, program, software, hardware,
human-ware, MODEM, CPU, Memory, Data, ALU, CU, CPU, OMR, OCR, LCD
Define a computer. List the components of computer hardware. Characteristics and
functions of a computer. Some important application areas of a computer.

A computer system consists of hardware and software. The computer hardware cannot perform
any task on its own. It needs to be instructed about the tasks to be performed. Software is a set
of programs that instructs the computer about the tasks to be performed. Software tells the
computer how the tasks are to be performed; hardware carries out these tasks. Different sets of
software can be loaded on the same hardware to perform different kinds of tasks. For example,
a user can use the same computer hardware for writing a report or for running a payroll
program.

Definition: A computer is an electronic device for storing and processing data, typically in binary
form, according to instructions given to it in a variable program.

Some of the most common components hardware are:


1. Monitor
2. Keyboard
3. Processor
4. Mouse
5. Memory
6. CPU
7. Motherboard
8. RAM
9. Graphics Card
10. Speaker

Characteristics or Importance off Computer


Speed, accuracy, diligence, storage capability and versatility are some of the key characteristics
of a computer. A brief overview of these characteristics are—

1. Speed: The computer can process data very fast, at the rate of millions of instructions per
second. Some calculations that would have taken hours and days to complete otherwise, can be
completed in a few seconds using the computer. For example, calculation and generation of
salary slips of thousands of employees of an organization, weather forecasting that requires
analysis of a large amount of data related to temperature, pressure and humidity of various
places, etc.

2. Accuracy: Computer provides a high degree of accuracy. For example, the computer can
accurately give the result of division of any two numbers up to 10 decimal places.

3. Diligence: When used for a longer period of time, the computer does not get tired or fatigued. It
can perform long and complex calculations with the same speed and accuracy from the start till
the end.

4. Storage Capability: Large volumes of data and information can be stored in the computer and
also retrieved whenever required. A limited amount of data can be stored, temporarily, in the
primary memory. Secondary storage devices like floppy disk and compact disk can store a large
amount of data permanently.

5. Versatility: Computers are versatile in nature. It can perform different types of tasks with the
same ease. At one moment you can use the computer to prepare a letter document and in the
next moment you may play music or print a document.

6. Reliability: A computer is reliable as it gives consistent result for a similar set of data i.e., if we
give same set of input any number of times, we will get the same result.

7. Automation: Computer performs all the tasks automatically i.e. it performs tasks without manual
intervention.

8. Data Security: Protecting digital data is understood as data security.

9. Multitasking: Multitasking is one of the main advantages of computers. A person can do multiple
tasks, and multiple operations at the same time, and calculate numerical problems within a few
seconds. The computer can perform millions or trillions of work in one second.

Computers have several limitations too. Computer can only perform tasks that it has been
programmed to do. Computer cannot do any work without instructions from the user. It executes
instructions as specified by the user and does not take its own decisions.
Basic Function of Computers
There are four basic functions of the computer: Input, Processing, Output, and Storage.

1. Input: This is the process of entering data and programs in to the computer system. Input is the
raw information entered into a computer from the input devices. It is the collection of letters,
numbers, images etc. The input device converts the data in the binary form so that the computer
can read the data. Input device includes the following-
● Keyboard
● Mouse
● Scanner
● Joystick
● Light pen
● TrackBall
● Graphic Table
● Plotter
● Optical Mark Reader(OMR)
● Barcode Reader

2. Processing: Central Processing Unit (CPU) plays a major role in the data processing. The CPU
is called the brain of the computer because it is the control centre of the computer. It is perform all
types of data processing operations. It stores data, intermediate results and instructions. It
controls the operation of all parts of computer. The CPU has three main components which are
responsible for different functions –

1. Arithmetic Logic Unit (ALU): ALU is the digital circuit that performs simple addition,
subtraction, multiplication, division, and logic operations, such as OR and AND

2. Control Unit (CU): Controlling of all operations like input, processing and output are
performed by the control unit. It takes care of step by step processing of all operations
inside the computer.

3. 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.

3. Output: This is the process of producing results from the data for getting useful information.
Output device converts the binary data coming from CPU to human understandable form. The
common output devices are-
● Monitor
● Printer
● Headphones
● Computer Speakers
● Projector
● GPS
● Sound Card
● Video Card
4. Memory: A memory is just like human brine. It is used to store data and instructions. There are
two types of memory:
1. Primary Memory : Primary memory is the component of the computer that holds data ,
programs and instructions that are currently in use. As a result, data can be read from
and written to primary memory extremely quickly.

2. Secondary Memory: Secondary memory is a external computer memory that is


non-volatile, long-term storage and not immediately accessible by a computer. It is also
called Backup memory or Additional memory or Auxiliary memory. These are used for
storing data permanently for future use. For example: Hard disk, CD-ROM, DVD, Blue
Ray Disk and Pen drive.

Importance and Limitations of computer


or
Disadvantages of computer

1. Virus and hacking attacks: A virus may be a worm and hacking is just unauthorized access
over a computer for a few illicit purposes. Viruses can go to another system from email
attachments, viewing an infected website advertisement, through removable devices like USBs,
etc.

2. Online Cyber Crimes: Online cyber-crime means computers and networks may have been
utilized in order to commit a crime. Cyberstalking and fraud are the points that come under online
cyber crimes.

3. Reduction in employed opportunity: Mainly past generation hasn’t used the pc or they need
the knowledge of computers they faced an enormous problem when computers came into the
field.
4.
5. High Cost: Computers are expensive. Even the foremost affordable computers are still very
expensive for the typical person in South Africa. Since computers empower people.

6. Distractions/disruptions: If you’ve got ever spent hours browsing the web or watching videos on
YouTube, then you recognize how distracting computers can be! Because of their high
entertainment value.

7. Increases waste and impacts the environment: With the speed at that computer and other
electronics get replaced, all of the old devices that get thrown away have a big impact on the
environment.

8. Health Problems: Prolonged use of computers can lead to various health Hazards. Too much
sitting near the screen results in eye strain and drying up of the eyes. Also, prolonged sitting
leads to neck and back problems.

Some important application areas of a computer


Computers have proliferated into various areas of our lives. For a user, computer is a tool that
provides the desired information, whenever needed. You may use computer to get information
about the reservation of tickets (railways, airplanes and cinema halls), books in a library,
medical history of a person, a place in a map, or the dictionary meaning of a word. The
information may be presented to you in the form of text, images, video clips, etc.

Some of the application areas of the computer are listed below—

1. Education: Computers are extensively used, as a tool and as an aid, for imparting education.
Educators use computers to prepare notes and presentations of their lectures. Computers are
used to develop computer-based training packages, to provide distance education using the
e-learning software, and to conduct online examinations. Researchers use computers to get easy
access to conference and journal details and to get global access to the research material.

2. Entertainment: Computers have had a major impact on the entertainment industry. The user can
download and view movies, play games, chat, book tickets for cinema halls, use multimedia for
making movies, incorporate visual and sound effects using computers, etc. The users can also
listen to music, download and share music, create music using computers, etc.

3. Sports: A computer can be used to watch a game, view the scores, improve the game, play
games (like chess, etc.) and create games. They are also used for the purposes of training
players.

4. Advertising: Computer is a powerful advertising media. Advertisement can be displayed on


different websites, electronic-mails can be sent and reviews of a product by different customers
can be posted. Computers are also used to create an advertisement using the visual and the
sound effects. For the advertisers, computer is a medium via which the advertisements can be
viewed globally. Web advertising has become a significant factor in the marketing plans of almost
all companies. In fact, the business model of Google is mainly dependent on web advertising for
generating revenues.

5. Medicine: Medical researchers and practitioners use computers to access information about the
advances in medical research or to take opinion of doctors globally. The medical history of
patients is stored in the computers. Computers are also an integral part of various kinds of
sophisticated medical equipments like ultrasound machine, CAT scan machine, MRI scan
machine, etc. Computers also provide assistance to the medical surgeons during critical surgery
operations like laparoscopic operations, etc.

6. Science and Engineering: Scientists and engineers use computers for performing complex
scientific calculations, for designing and making drawings (CAD/CAM applications) and also for
simulating and testing the designs. Computers are used for storing the complex data, performing
complex calculations and for visualizing 3– dimensional objects. Complex scientific applications
like the launch of the rockets, space exploration, etc., are not possible without the computers.

7. Government: The government uses computers to manage its own operations and also for
e-governance. The websites of the different government departments provide information to the
users. Computers are used for the filing of income tax return, paying taxes, online submission of
water and electricity bills, for the access of land record details, etc. The police department uses
computers to search for criminals using fingerprint matching, etc.

8. Home: Computers have now become an integral part of home equipment. At home, people use
computers to play games, to maintain the home accounts, for communicating with friends and
relatives via Internet, for paying bills, for education and learning, etc. Microprocessors are
embedded in house hold utilities like washing machines, TVs, food processors, home theaters,
security devices, etc.

9. Bank Industries: Computers are used by Banks and Insurance industries to manage financial
transactions. They use special cash dispensing machines called Automated Teller Machines
(ATMs) to enable them to provide cash deposit & withdrawal services. For processing of
Cheques, for preparation of Payrolls, for better record keeping and processing of documents. To
provide electronic money transfer facilities.

10. Research: Computers can be used for research in various fields. They are used by Scientists to
analyze their experimental data, e.g., in weather forecasting. Engineers & Architects to design &
test their work.

The list of applications of computers is so long that it is not possible to discuss all of them here.
In addition to the applications of the computers discussed above, computers have also
proliferated into areas like banks, investments, stock trading, accounting, ticket reservation,
military operations, meteorological predictions, social networking, business organizations, police
department, video conferencing, telepresence, book publishing, web newspapers, and
information sharing.

Brief Explanation of the generation of the Computer

The evolution of computers to their present state is divided into five generations of computers,
based on the hardware and software they use, their physical appearance and their computing
characteristics.

With the advent of your time, the modern computer began to take shape. The development of the
computer had begun in the sixteenth century. Numerous improvements were made to the original
computer. It continued to advance in terms of speed, accuracy, size, and cost in order to push the design
of the current day computer.

This extensive time is frequently easily split into the following segments known as computer generations:

1. First generation computers were vacuum tubes based machines. These were large in
size, expensive to operate and instructions were written in machine language. Their
computation time was in milliseconds.
2. Second generation computers were transistor based machines. They used the stored
program concept. Programs were written in assembly language. They were smaller in
size, less expensive and required less maintenace than the first generation computers.
The computation time was in microseconds.

3. Third generation computers were characterized by the use of IC. They consumed less
power and required low maintenance compared to their predecessors. High-level
languages were used for programming. The computation time was in nanoseconds.
These computers were produced commercially.

4. Fourth generation computers used microprocessors which were designed using the LSI
and VLSI technology. The computers became small, portable, reliable and cheap. The
computation time is in picoseconds. They became available both to the home user and
for commercial use.

5. Fifth generation computers are capable of learning and self organization. These
computers use SLSI chips and have large memory requirements. They use parallel
processing and are based on AI. The fifth generation computers are still being
developed.

Definition:

1. Program: A computer program is a sequence or set of instructions in a programming language


for a computer to execute.

2. Software: Software is a collection of programs and data that tell a computer how to perform
specific tasks.

3. Hardware: Hardware refers to the physical parts of a computer, such as the central processing
unit (CPU), random access memory (RAM), motherboard.

4. ALU: ALU stands for Arithmetic Logic Unit. The ALU in the computer performs arithmetic and
logical operations as part of the CPU, and as commanded by the CU.

5. CU: The control unit (CU) is a component of a computer's central processing unit (CPU) that
directs the operation of the processor.

6. CPU Central processing unit or CPU is a hardware that performs data input/output, processing
and storage functions for a computer system.

7. Data: Data are isolated values or raw facts, which by themselves have no much significance.
What is a CPU? Discuss the component parts of the CPU briefly.

Central processing unit or CPU is a hardware that performs data input/output, processing and
storage functions for a computer system.

Central Processing Unit (CPU) or the processor is also often called the brain of a computer.
CPU consists of Arithmetic Logic Unit (ALU) and Control Unit (CU). In addition, CPU also has a
set of registers which are temporary storage areas for holding data, and instructions.

Brief explanation of each of them:

ALU : The arithmetic logic unit (ALU) performs basic arithmetic operations (addition, subtraction,
multiplication, and division) and logical operations (AND, OR, and NOT) on data. It receives data from
registers within the CPU, processes it based on the instructions from the control unit, and produces the
result.

CU: The control unit manages instruction processing and coordinates data flow within the CPU and
between other computer components. It has an instruction decoder component that interprets the
instructions fetched from memory and converts them into micro-operations that the CPU can run. The
control unit directs other CPU components to perform required operations.

Registers: Registers are small, high-speed memory storage locations within the CPU. They hold data
that the CPU is currently working on and facilitate quick access to data. CPUs have several types of
registers,

Write Short notes on Arithmetic Logic Unit (ALU) and Control Unit (CU).

The most essential component of a computer is the Central Processing Unit. It is popularly known as
CPU. It is used to process instructions. The principal component of the CPU is the Arithmetic Logic Unit
and Control Unit.
Arithmetic Logic Unit: ALU stands for Arithmetic Logic Unit. It is a very essential part of the CPU. It
performs all the basic arithmetic (addition, subtraction, multiplication, and division) operations and logical
operations. The ALU is typically designed in such a way that it has direct input and output access to the
random access memory (RAM). In modern computers, the ALU is itself is divided into two categories:

● Arithmetic Unit (AU)


● Logic Unit (LU)

Functions of ALU :
● Input operands, adding operands, accumulated results, and shifting results can all be stored in
the ALU.
● ALU subunits carried out gated circuits regulate the flow of data and the operations. A series of
adding, subtracting, and shifting operations are used for division and multiplication.

● It performs arithmetic operations like addition, subtraction, multiplication, and division operations
also it performs logical operations.

Control Unit(CU): CU stands for Control Unit. It is one of the fundamental parts of the CPU. The main
work of the CU is to tell the most efficient method to work. It guides all the related operations to the
individual parts of the processor. Some basic operation performed by it includes taking guidelines,
controlling sequential execution, managing information stream in the correct course, directing and
observing the time needed amid the preparing and taking care of different functions, etc. It controls the
operations of the processor. It informs the ALU, I/O devices, and the RAM how to respond to the
command that has been sent to the processor. A control unit directs the system and executes instructions
entered by the user.

Functions of Control Unit(CU):

● Controls how data is sent through the CPU’s various components.


● Receives and transmits control signals from other devices.
● Interprets commands, controls processor time, and regulates.
● Decode, fletch, carry out the order, and store the results, among other responsibilities.
● Interprets directions and directives.

Write a detailed explanation of the use of Cache Memory.

The memory unit consists of cache memory and primary memory. Cache memory is a very high speed
memory placed in between RAM and CPU. Cache memory increases the speed of processing. Cache
memory is a storage buffer that stores the data that is used more often, temporarily, and makes them
available to CPU at a fast rate. During processing, CPU first checks cache for the required data. If data is
not found in cache, then it looks in the
RAM for data.

To access the cache memory, CPU does not have to use the motherboard’s system bus for
data transfer.
Cache memory is built into the processor, and may also be located next to it on a separate chip between
the CPU and RAM. Cache built into the CPU is faster than separate cache, running at the speed of the
microprocessor itself. However, separate cache is roughly twice as fast as RAM.

The CPU has a built-in Level 1 (L1) cache and Level2 (L2) cache, as shown in Figure 2.3. In addition to
the built-in L1 and L2 cache, some CPUs have a separate cache chip on the motherboard. This cache on
the motherboard is called Level 3 (L3) cache. Nowadays, the high-end processor comes with built-in L3
cache, like in Intel core i7. The L1, L2 and L3 cache store the most recently run instructions, the next
ones and the possible ones, respectively. Typically, CPUs have cache size varying from 256KB (L1), 6
MB (L2), to 12MB (L3) cache.

Cache memory is very expensive, so it is smaller in size. Generally, computers have cache memory of
sizes 256 KB to 2 MB.

Differentiate Between primary and secondary memory.

Primary Memory: Primary memory is a computer system's internal memory. It stores and retrieves data,
instructions, and information. The CPU directly and randomly accesses primary memory, which is also
referred to as Random Access Memory (RAM). Primary memory is volatile and loses data and
instructions when the power turns off.

Secondary Memory: Secondary memory is a type of computer memory that is used to store data and
programs that can be accessed or retrieved even after the computer is turned off. Unlike primary memory,
which is volatile and temporary, secondary memory is non-volatile and can store data and programs for
extended periods of time.
Difference between them:

type

Define Pipelining and Parallel Processing:

1. Pipelining improves instruction execution speed by putting the execution steps into parallel. A
CPU can receive a single instruction, begin executing it, and receive another instruction before it
has completed the first. This allows for more instructions to be performed, about, one instruction
per clock cycle.

It is the characteristic of pipelining that several computations can be in progress in distinct


segments at the same time. Each segment performs partial processing dictated by the way
the task is dictated The result obtained from computation is in each segment is transferred to
next segment in the pipeline and final result is obtained after data has been passed through
all segment.
game
2. Parallel Processing is the simultaneous execution of instructions from the same program on
different part of cpu different processors. A program is divided into multiple processes that are handled in parallel in
order to reduce execution time.

The purpose of parallel processing is to speed up the computer processing capability and
increase its throughput, i.e. the amount of processing that can be accomplished during a
given interval of time.

What is Microprocessor and what does it in a computer system? Write a comparative analysis on
RISC and CISC. subpart/part of CPU

The microprocessor is a multipurpose, clock-driven, register-based, digital integrated


circuit that accepts binary data as input, processes it according to instructions stored in
its memory, and provides results (also in binary form) as output.

It can function as the “brain” of a personal desktop computer. A computer's


microprocessor performs arithmetic and logic operations, provides temporary memory
storage, and times and regulates all elements of the computer system.

CISC architecture hardwires the processor with complex instructions, which are difficult
to create otherwise using basic instructions. CISC combines the different instructions
into one single CPU.
1. CISC has a large instruction set that includes simple and fast instructions for
performing basic tasks, as well as complex instructions that correspond to
statements in the high level language.
2. An increased number of instructions (200 to 300) results in a much more
complex
3. processor, requiring millions of transistors.
4. Instructions are of variable lengths, using 8, 16 or 32 bits for storage. This results
in the processor’s time being spent in calculating where each instruction begins
and ends.
5. With large number of application software programs being written for the
processor, a new processor has to be backwards compatible to the older version
of processors.
6. AMD and Cyrix are based on CISC.

RISC has simple, single-cycle instructions, which performs only basic instructions. RISC
architecture does not have hardwired advanced functions. All high-level language
support is done in the software.
1. RISC has fewer instructions and requires fewer transistors, which results in the
reduced manufacturing cost of processor.
2. The instruction size is fixed (32 bits). The processor need not spend time in
finding out where each instruction begins and ends.
3. RISC architecture has a reduced production cost compared to CISC processors.
4. The instructions, simple in nature, are executed in just one clock cycle, which
speeds up the program execution when compared to CISC processors.
5. RISC processors can handle multiple instructions simultaneously by processing
them in parallel.
6. Apple Mac G3 and PowerPC are based on RISC.

Processors like Athlon XP and Pentium IV use a hybrid of both technologies.

Define RAM and ROM. Difference between them.

1. Random Access Memory: Random Access Memory (RAM) is used to store the programs and
data being used by the CPU in real time. The data on the random access memory can be read,
written, and erased any number of times. RAM is a hardware element where the data currently
used is stored. It is a volatile memory. It is also called as Main Memory or Primary Memory. This
is user’s memory. The software (program) as well as data files are stored on the hard disk when
the software or those files are opened. They get expanded into RAM. It is the space where
temporary data are automatically stored until the user saves it into the secondary storage
devices.
2. Read Only Memory: Read Only Memory (ROM) is a type of memory where the data has been
pre-recorded. Data stored in ROM is retained even after the computer is turned off i.e.,
non-volatile. It is generally used in Embedded Parts, where the programming requires almost no
changes. It is also called as Secondary Memory. It is a permanent CNO4 erasable memory gets
initiated when the power is supplied to the computer ROM is a memory chip fixed on the
motherboard at the time of manufacturing. It stores a program called BIOS(Basic Input Output
Setup). This program checks the status of all the devices attached to the computer.
What is computer bus? Write about three types of system buses.

In computer architecture, a bus (historically also called data highway or databus) is a


communication system that transfers data between components inside a computer, or
between computers.

The system bus is a pathway composed of cables and connectors used to carry data
between a computer microprocessor and the main memory.

The different components of computer are connected with each other by a bus. A
computer bus is of two types—system bus and expansion bus.

1. The System Bus connects the CPU, system memory, and all other components
on the motherboard.

2. The Expansion Bus connects the different external devices, peripherals,


expansion slots, I/O ports and drive connections to the rest of the computer.

A system bus or expansion bus comprise of three kinds of buses— data bus, address
bus and control bus.

1. Data Bus
● The most common is the data bus.A data bus carries data.
● It is an electrical path that connects the CPU,Memory,Input/output devices, and
secondary storage devices.
● The bus contains parallel group of lines.
● The number of lines in bus affects the speed at which the data travels between
different components.

2.Address Bus
● An address bus carries address information.It is a set of wires similar to the data
bus but it only connects CPU and memory.
● Whenever the processor needs data from the memory,it places the address of
data on the address bus.
● The address is carried to the memory where the data from the requested address
is fetched and placed on the data bus.The data bus carried to the CPU.
3.Control Bus
● The control bus carries control information from the control unit to other units.
● The control information is used for directing the activities of all units.
● The control unit control the functioning of other units

Explain about the memory hierarchy of a computer system with appropriate


figure.

Memory Hierarchy: The memory is characterized on the basis of two key factors—
● capacity
● access time

Capacity is the amount of information (in bits) that a memory can store. Access time is the time
interval between the read/ write request and the availability of data. The lesser the access time,
the faster is the speed of memory. Ideally, we want the memory with fastest speed and largest
capacity. However, the cost of fast memory is very high. The computer uses a hierarchy of
memory that is organized in a manner to enable the fastest speed and largest capacity of
memory. The hierarchy of the different memory types is shown in Figure 3.2.
The internal memory and external memory are the two broad categories of memory used in the
computer. The internal memory consists of the CPU registers, cache memory and primary
memory. The internal memory is used by the CPU to perform the computing tasks. The external
memory is also called the secondary memory. The secondary memory is used to store the large
amount of data and the software .

In general, referring to the computer memory usually means the internal memory.

Internal Memory—The key features of internal memory are—


1. limited storage
2. capacity,
3. temporary storage,
4. fast access, and
5. high cost.

Registers, cache memory, and primary memory constitute the internal memory. The primary
memory is further of two kinds—RAM and ROM. Registers are the fastest and the most
expensive among all the memory types. The registers are located inside the CPU, and are
directly accessible by the CPU. The speed of registers is between 1—2 ns (nanosecond). The
sum of the size of registers is about 200B. Cache memory is next in the hierarchy and is placed
between the CPU and the main memory. The speed of cache is between 2—10 ns. The cache
size varies between 32 KB to 4MB. Any program or data that has to be executed must be
brought into RAM from the secondary memory. Primary memory is relatively slower than the
cache memory. The speed of RAM is around 60ns. The RAM size varies from 512KB to 3GB.
CPU Registers: Registers are very high-speed storage areas located inside the CPU. After
CPU gets the data and instructions from the cache or RAM, the data and instructions are moved
to the registers for processing. Registers are manipulated directly by the control unit of CPU
during instruction execution. That is why registers are often referred to as the CPU’s working
memory. Since CPU uses registers for the processing of data, the number of registers in a CPU
and the size of each register affect the power and speed of a CPU. The more the number of
registers (ten to hundreds) and bigger the size of each register (8 bits to 64 bits), the better it is.

Cache Memory: Cache memory is placed in between the CPU and the RAM. Cache memory is
a fast memory, faster than the RAM. When the CPU needs an instruction or data during
processing, it first looks in the cache. If the information is present in the cache, it is called a
cache hit, and the data or instruction is retrieved from the cache. If the information is not present
in cache, then it is called a cache miss and the information is then retrieved from RAM. The
content of cache is decided by the cache controller (a circuit on the motherboard). The most
recently accessed information or instructions help the controller to guess the RAM locations that
may be accessed next. To get good system performance, the number of hits must far
outnumber the misses. The two main factors that affect the performance of cache are its size
and level (L1, L2 and L3).

Primary Memory: Primary memory is the main memory of computer. It is a chip mounted on the
motherboard of computer. Primary memory is categorized into two main types-

● Random Access Memory (RAM), and


● Read Only Memory (ROM)

Secondary Memory: Secondary memory is a type of computer memory that is used to store
data and programs that can be accessed or retrieved even after the computer is turned off.
Unlike primary memory, which is volatile and temporary, secondary memory is non-volatile and
can store data and programs for extended periods of time. key features of secondary memory
storage devices are—
1. very high storage capacity,
2. permanent storage (non-volatile), unless erased by user,
3. relatively slower access,
4. stores data and instructions that are not currently being
5. used by CPU but may be required later for processing, and
6. cheapest among all memory.
However, there are also some disadvantages to secondary memory, such as slower access
times and lower read/write speeds compared to primary memory. Additionally, secondary
memory devices are often more prone to mechanical failures and data corruption, which can
result in data loss.
Overall, secondary memory plays an important role in modern computing systems and is
essential for storing large amounts of data and programs.

The storage devices consist of two parts—drive and device. For example, magnetic tape drive
and magnetic tape, magnetic disk drive and disk, and, optical disk drive and disk. The speed of
magnetic disk is around 60ms. The capacity of a hard disk ranges from 160 GB to 1,600 GB
(1.6 Tera Bytes). Figure 3.3 shows the interaction between CPU and memory.

Figure 3.3 CPU and the memory

To get the fastest speed of memory with largest capacity and least cost, the fast memory is
located close to the processor. The secondary memory, which is not as fast, is used to store
information permanently, and is placed farthest from the processor. With respect to CPU, the
memory is organized as follows—

1. Registers are placed inside the CPU (small capacity, high cost, very high speed)
2. Cache memory is placed next in the hierarchy (inside and outside the CPU)
3. Primary memory is placed next in the hierarchy
4. Secondary memory is the farthest from CPU (large capacity, low cost, low speed)

Sequential Access Devices: Sequential access means that computer must run through the
data in sequence, starting from the beginning, in order to locate a particular piece of data.
Magnetic tape is an example of sequential access device. Let us suppose that magnetic tape
consists of 80 records. To access the 25th record, the computer starts from first record, then
reaches second, third etc. until it reaches the
25th record. Sequential access devices are generally slow devices.

Direct Access Devices: Direct access devices are the ones in which any piece of data can be
retrieved in a non-sequential manner by locating it using the data’s address. It accesses the
data directly, from a desired location. Magnetic disks and optical disks are examples of direct
access devices. There is no predefined order in which one can read and write data from a direct
access device. In a magnetic disk consisting of 80 records, to access the 25th record, the
computer can directly access the 25th record, without going past the first 24 records. Based on
access, magnetic tapes are sequential access devices, and, magnetic disks, optical disk and
magneto-optical disks are direct access devices.

Magnetic Disk: Magnetic disk is a direct access secondary storage device. It is a thin plastic or
metallic circular plate coated with magnetic oxide and encased in a protective cover. Data is
stored on magnetic disks as magnetized spots. The presence of a magnetic spot represents the
bit 1 and its absence
represents the bit 0.

Hard Disk: Primary memory has limited storage capacity and it is volatile. Secondary memory
overcomes this limitation by providing permanent storage of data in bulk quantity. Secondary
memory is also termed external memory and refers to the various storage media on which a
computer can store data and programs. The Secondary storage media can be fixed or
removable. Fixed Storage media is an internal storage medium like a hard disk that is fixed
inside the computer.

Describe briefly about RAM. Differentiate SRAM and DRAM.

RAM (random access memory) is a computer's short-term memory, where the data that
the processor is currently using is stored. RAM is a form of temporary storage that gets
wiped when we turn our computer off. RAM offers lightning-fast data access, which
makes it ideal for the processes, apps, and programs your computer is actively working
on, such as the data needed to surf the internet through our web browser.

DRAM is the most common type of memory chip. DRAM is mostly used as main
memory since it is small and cheap.

SRAM chip is usually used in cache memory due to its high speed.

Difference between them:


Structural Difference:

Define CPU Scheduling. Describe in brief three types of scheduling.


CPU scheduling is the task performed by the CPU that decides the way and order in which
processes should be executed. There are two types of CPU scheduling - Preemptive, and
non-preemptive. The purpose of CPU Scheduling is to make the system more efficient, faster,
and fairer.

1. First Come First Served (FCFS) Scheduling: As the name says, the process that requests for
the CPU first, gets the CPU first. A queue is maintained for the processes requesting the CPU.
The process first in the queue is allocated the CPU first. FCFS scheduling is non-pre-emptive.
The drawback of this scheduling algorithm is that the process that is assigned to the CPU may
take long time to complete, keeping all other processes waiting in the queue, even if they require
less CPU time.

2. Shortest Job First (SJF) Scheduling: The process that requires the least CPU time is allocated
the CPU first. SJF scheduling is non-pre-emptive. The drawback of this scheduling is that a
process that requires more CPU time may have to wait for long time, since processes requiring
less CPU time will be assigned the CPU first.

3. Round Robin (RR) Scheduling: It is designed for time-sharing systems. RR scheduling is


pre-emptive. In this scheduling, a small quantum of time (10—100 ms) is defined, and each
process in the queue is assigned the CPU for this quantum of time circularly. New processes are
added at the tail of the queue and the process that has finished execution is removed from the
queue. RR scheduling overcomes the disadvantage of FCFS and SJF scheduling. A process
does not have to wait for long, if it is not the first one in the queue, or, if it requires CPU for a long
period of time.

Define compiler and interpreter. Difference between compiler and interpreter.

Compiler: A Compiler is a computer program that translates computer code written in one programming
language into another programming language. A Compiler takes the entire program and converts it into
executable computer code. Examples of compiled programming languages are C and C++. A Compiler is
likely to perform many or all the operations: preprocessing, lexical analysis, parsing, semantic analysis,
conversion of input programs to an intermediate representation, code optimizing and code generation.

Interpreter: An Interpreter is a computer program, which converts each high-level program statement into
machine code. This include source code, pre-compiled code, and scripts. An Interpreter is defined as a
machine program that directly executes a set of instructions without compiling them. Examples of
interpreted languages are Perl, Python and Matlab.

Both Compiler and Interpreter do the same job which is converting high-level programming language to
machine code. However, a compiler will convert the code into machine code before the program run.
Interpreter covers code into machine code when the program is run.
Numbering System

Decimal to binary, octal and hexadecimal (divide by base and for fraction multiply
by base)
Binary, octal and hexadecimal to Decimal
Binary To Octal, Hexadecimal
Octal, Hexadecimal To Binary

Binary addition, and Binary subtraction.


Write short description on EBCDIC, ASCII and Unicode

EBCDIC: EBCDIC is well known as the Extended Binary Coded Decimal Interchange
Code. A character is described by an 8-bit code, such as EBCDIC. It may represent up
to 256 characters, which can be any combination of letters, special characters, integers,
and control characters. the main distinctive feature of EBCDIC is its capability to support
a broad range of languages and character sets.

1. The Extended Binary Coded Decimal Interchange Code (EBCDIC) uses 8 bits (4
bits for zone, 4 bits for digit) to represent a symbol in the data.

2. EBCDIC allows 28 = 256 combinations of bits.

3. 256 unique symbols are represented using EBCDIC code. It represents decimal
numbers (0−9), lower case letters (a−z), uppercase letters (A−Z), Special
characters, and Control characters (printable and non−printable, e.g., for cursor
movement, printer vertical spacing, etc.).

4. EBCDIC codes are mainly used in the mainframe computers.

Advantages Of Ebcdic: With fewer bits needed to represent a character, the code is
more efficient. Unlike ASCII, it includes built-in error-checking capabilities.

ASCII: ASCII (American Standard Code for Information Interchange) is the most common
character encoding format for text data in computers and on the internet. In standard
ASCII-encoded data, there are unique values for 128 alphabetic, numeric or special
additional characters and control codes.
1. ASCII codes are of two types—ASCII−7 and ASCII−8. ASCII-7 is a 7-bit standard
ASCII code.

2. In ASCII-7, the first 3 bits are the zone bits and the next 4 bits are for the digits.
ASCII-7 allows 27 = 128 combinations. 128 unique symbols are represented using
ASCII-7. ASCII-7 has been modified by IBM to ASCII-8. ASCII-8 is an extended
version of ASCII-7.

3. ASCII-8 is an 8-bit code having 4 bits for zone and 4 bits for the digit. ASCII-8 allows
28 = 256 combinations. ASCII-8 represents 256 unique symbols. ASCII is used
widely to represent data in computers.

4. The ASCII-8 code represents 256 symbols.

Advantages of ASCII: ASCII is easy to use and suitable across most platforms. To store all
alphanumeric characters, ASCII coding uses the English language. With only 256
characters, ASCII coding requires less storage space.

Unicode: Unicode is a universal encoding system to provide a comprehensive character set


and was created by the Unicode Consortium (a group of multilingual software
manufacturers). Unicode simplifies software localization and improves multilingual text
processing. It overcomes the difficulty inherent in ASCII and extended ASCII. Unicode has
standardizes script behavior which allows any combination of characters,

1. Unicode uses 32 bits to represent a symbol in the data. Unicode allows 232 =
4164895296 (~ 4 billion) combinations.

2. Unicode can uniquely represent any character or symbol present in any language
like Chinese, Japanese, etc. In addition to the letters; mathematical and scientific
symbols are also represented in Unicode codes.

3. An advantage of Unicode is that it is compatible with the ASCII−8 codes. The first
256 codes in Unicode are identical to the ASCII-8 codes.

4. Unicode is implemented by different character encodings.

Advantage of Unicode: Unicode supports almost all the characters and symbols used in
the world’s writing systems, making it a universal character set that can be used to
represent text in any language.
Draw the instruction fetch cycle of a computer and explain eatch step

The fetch execute cycle is a computer’s most basic operation. The instruction set is a specialised
collection of instructions or tasks that the CPU is designed to perform. It retrieves and executes
instructions from the main memory. This is repeated from the time the computer is turned on to the time it
is turned off.

The CPU, often known as the processor, is the computer’s brain. It is in charge of carrying out a program,
which is a set of instructions. A program accepts data, processes it, and returns results. By using the
stages of the fetch execute cycle, the CPU’s principal responsibility is to execute programs. The
instruction cycle is another name for this. The cycle begins when the computer is switched on and ends
when it is turned off.

A instruction cycle involves four steps (Figure 2.9)—

1. Fetching The processor fetches the instruction from the memory. The fetched instruction is placed
in the Instruction Register. Program Counter holds the address of next instruction to be fetched
and is incremented after each fetch.

2. Decoding The instruction that is fetched is broken down into parts or decoded. The instruction is
translated into commands so that they correspond to those in the CPU’s instruction set. The
instruction set architecture of the CPU defines the way in which an instruction is decoded.

3. Executing The decoded instruction or the command is executed. CPU performs the operation
implied by the program instruction. For example, if it is an ADD instruction, addition is performed.

4. Storing CPU writes back the results of execution, to the computer’s memory.

You might also like