FOC Unit 1
FOC Unit 1
Any computer can perform the four basic operations of Input, Processing, Output, and Storage (IPOS).
These operations constitute the IPOS cycle. The internal design or structure of a computer may differ
from one system to another though the basic operations remain the same.
Figure 1.1 provides a block diagram of a computer. The figure displays all the functional units of a
computer which carry out the basic computer operations. The lines in the figure indicate the flow of
instructions and data, while the Control Unit and the Arithmetic/Logical Unit together direct the flow of
control in the central processing unit.
Input Unit:
Data and instructions are entered into the computer through the input unit to get processed into
information. Input devices like the keyboard, the mouse, or the microphone are used to enter the
data.
The data is entered in various forms depending on the type of input devices. For instance, a
keyboard can be used to input characters, numbers, and certain symbols.
Mouse is a device that has an on-screen pointer that enables the users to select items and choose
options.
Microphone can be used if the user wishes to enter instructions by making a voice entry.
Regardless of the ways in which the input devices receive the inputs, the input interfaces convert
them into binary codes, i.e., 0s and 1s, as the primary memory of the computer is designed to
accept data only in this format.
Page 1 of 19
Fundamentals of Programing & Problem-Solving Unit -I
Several advancements can be seen in input devices with devices like cordless keyboards, optical
mouse, laser mouse, cordless mouse, etc., being introduced in the market.
Control unit:
The CU obtains the program instructions stored in the primary memory of the computer,
interprets them, and issues signals that result in their execution.
It helps in maintaining order and directs the operations of the entire system.
It selects, interprets, and ensures the proper execution of the program instructions.
Output Unit:
The output unit passes on the final results of computation to the users through the output devices
like the monitor, printer, etc.
A monitor displays the final results of the processed data on the screen while a printer can be
used for obtaining the output in a printed format.
These output devices link the computer with the users.
The output interfaces convert the binary code produced by the computer into the human-readable
form.
Memory Unit:
The main memory is referred to as the internal memory or primary memory of the computer. It is
also known as Random Access Memory (RAM).
It is a temporary storage medium that holds the data only for a short period of time.
Once the computer is switched off, the data stored in the RAM gets erased.
The memory space of RAM is limited and therefore all the fi les and instructions cannot be stored in
it.
These files and instructions are normally stored in a different location known as secondary storage
and are copied from there to the RAM before execution. This technique is referred as swapping.
Page 2 of 19
Fundamentals of Programing & Problem-Solving Unit -I
The memory space available in RAM also affects the speed of a computer system.
If the memory space is more, a greater number of instructions can be copied and executed at the
same time. As a result, the computer system need not read the data from the secondary storage again
and again, thus making the processing faster.
The main memory is also responsible for holding intermediate data transferred between CPU and the
I/O devices.
II. INPUT DEVICE DEFINITION: A piece of equipment/hardware which help us enter data into a
computer is called an input device. For example, keyboard, mouse, etc.
2.Mouse
● It is also known as a pointing device
● Using mouse we can directly click on the various icons present on the system and open
up various files and programs
● A mouse comprises 3 buttons on the top and one trackball at the bottom which helps in
selecting and moving the mouse around, respectively
● In case of laptops, the touchpad is given as a replacement of mouse which helps in
the movement of the mouse pointer
3.Joy Stick
● It is a device which comprises a stick which is attached at an angle to the base, so that it can
be moved and controlled
● Mostly used to control the movement in video games
● Apart from computer system, a joystick is also used in the cockpit of an aeroplane, wheel
chairs, cranes, trucks, etc. to operate them well
4.Light Pen
● It is wand-like looking device which can directly be moved over the device’s screen
● It is light sensitive
● Used in conjunction with computer’s cathode ray tube
5.Microphone
● Using a microphone, sound can be stored in a device in its digital form
● It converts sound into electrical signal
● To record or reproduce a sound created using a microphone, it needs to be connected with an
amplifier
Page 3 of 19
Fundamentals of Programing & Problem-Solving Unit -I
6.Scanner
● This device can scan images or text and convert it into a digital signal
● When we place any piece of document on a scanner, it converts it into a digital signal
and displays it on the computer screen
7.Barcode Reader
● It is a kind of an optical scanner
● It can read bar codes
● A source of light is passed through a bard code, and its aspects and details are displayed on the
screen
III. OUTPUT DEVICE DEFINITION: A piece of equipment/hardware which gives out the
result of the entered input, once it is processed (i.e. converts data from machine language to a
human-understandable language), is called an output device. For example printer, monitor, etc.
1.Monitor
● The device which displays all the icons, text, images, etc. over a screen is called the Monitor
● When we ask the computer to perform an action, the result of that action is displayed on
the monitor
● Various types of monitors have also been developed over the years
2.Printer
● A device which makes a copy of the pictorial or textual content, usually over a paper is
called a printer
● For example, an author types the entire book on his/her computer and later gets a print out of
it which is in the form of paper and is later published
● Multiple types of printers are also available in the market, which can serve different purposes
3.Speakers
● A device through which we can listen to a sound as an outcome of what we command
a computer to do is called a speaker
● Speakers are attached with a computer system and also are an hardware device which can be
attached separately
● With advancement in technology, speakers are now available which are wireless and can be
connected using bluetooth or other applications
4.Projector
● An optical device which presents an image or moving images onto a projection screen is
called a projector
● Most commonly these projectors are used in auditoriums and movie theatres for display of
the videos or lightening
● If a projector is connected to a computer, then the image/video displayed on the screen is
the same as the one displayed on the computer screen
5.Headphones
● They perform the same function as a speaker, the only difference is the frequency of sound
Page 4 of 19
Fundamentals of Programing & Problem-Solving Unit -I
● Using speakers, the sound can be heard over a larger area and using headphones, the sound is
only audible to the person using them
● Also known as earphones or headset
Page 5 of 19
Fundamentals of Programing & Problem-Solving Unit -I
Arithmetic Unit
Arithmetic Unit (AU) is a part of the CPU that performs arithmetic operations on the data.
The arithmetic operations can be addition, subtraction, multiplication or division.
It handles the core calculations and logical decision-making processes needed during program
execution.
Page 6 of 19
Fundamentals of Programing & Problem-Solving Unit -I
AU takes the input in the form of an instruction that contains an opcode, operands and the format
code.
The opcode specifies the operation to be performed and the operands specify the data on which
operation is to be performed.
The output of AU contains the result of the operation and the status of the result, whether it is
final or not.
The output is stored in a storage register by the AU.
Register is a small storage area inside the CPU from where data is retrieved faster than any other
storage area
Logic Unit
Logic Unit (LU) is a part of the CPU that performs logical operations on the data.
It performs 16 different types of logical operations.
The various logical operations include greater than (>), less than (<), equal to (=), not equal to
(≠), shift left, shift right, etc.
LU makes use of various logic gates, such as AND, OR, NOR, etc for performing the logical
operations on the data.
Control Unit
Control Unit (CU) is an important component of CPU that controls the flow of data and
information.
It maintains the sequence of operations being performed by the CPU.
It fetches an instruction from the storage area, decodes the instruction and transmits the
corresponding signals to the AU or LU and the storage registers.
CU guides the AU and LU about the operations that are to be performed and also suggests the I/O
devices to which the data is to be communicated.
CU uses a program counter register for retrieving the next instruction that is to be executed. It
also uses a status register for handling conditions such as overflow of data
Memory Unit:
The main memory is referred to as the internal memory or primary memory of the computer. It is
also known as Random Access Memory (RAM).
It is a temporary storage medium that holds the data only for a short period of time.
Once the computer is switched off, the data stored in the RAM gets erased.
The memory space of RAM is limited and therefore all the fi les and instructions cannot be stored in
it.
These files and instructions are normally stored in a different location known as secondary storage
and are copied from there to the RAM before execution. This technique is referred as swapping.
Cache Memory
Cache memory is a small, high-speed memory located either within the CPU or very close to it. It stores
copies of frequently accessed data and instructions from main memory.
Levels:
Primary Cache (L1 Cache): Fastest and closest to the CPU, often built into the processor.
Secondary Cache (L2 and L3 Cache): Slightly slower but still faster than main memory, located between
the CPU and main memory.
Cache reduces the time it takes to access data and instructions, improving overall processing speed by
minimizing the need to fetch data from slower main memory.
Page 7 of 19
Fundamentals of Programing & Problem-Solving Unit -I
Registers
Registers are small, high-speed storage areas within the CPU that temporarily hold data and instructions.
They provide fast access to data that the CPU is currently processing. d. A processor can have different
types of registers to hold different types of information. They include, among others:
Primary memory:
It is also known as the main memory of the computer system. It is used to store data
and programs or instructions during computer operations.
Primary memory is of two types:
RAM (Random Access Memory)
ROM (Read Only Memory)
The data or information stored in secondary memory is permanent, and it is slower than
primary memory.
A CPU cannot access secondary memory directly.
2. Secondary Memory is types
Magnetic Tapes
Magnetic Disks
Optical Disks
Magnetic Tapes
It is a long, narrow strip of plastic film with a thin, magnetic coating on it that is used for
magnetic recording. Bits are recorded on tape as magnetic patches called RECORDS that run along
many tracks.
Magnetic Disks
A magnetic disk is a circular metal or a plastic plate and these plates are coated with magnetic
material. The disc is used on both sides. Bits are stored in magnetized surfaces in locations called tracks
that run in concentric rings.
Optical Disks
It’s a laser-based storage medium that can be written to and read.
The most commonly used storage devices in today’s time are magnetic storage devices. These are
affordable and easily accessible. A large amount of data can be stored in these through magnetized
mediums. A magnetic field is created when the device is attached to the computer and with the
help of the two magnetic polarities, the device is able to read the binary language and store the
information. Given below are the examples of magnetic storage devices.
● Floppy Disk - Also known as a floppy diskette, it is a removable storage device which is in
the shape of a square and comprises magnetic elements. When placed in the disk reader of
the computer device, it spins around and can store information. Lately, these floppy disks
have been replaced with CDs, DVDs and USB drives
● Hard Drive - This primary storage device is directly attached to the motherboard’s disk
controller. It is an integral storage space as it is required to install any new program or application
to the device. Software programs, images, videos, etc. can all be saved in a hard drive and
hard drives with storage space in terabytes are also easily available now
● Zip Disk - Introduced by Iomega, is a removable storage device which was initially
released with a storage space of 100 MB which was later increased to 250 and then finally
750 MB
● Magnetic Strip - A magnetic strip is attached in the device comprising digital data. The most
suitable example for this is a debit card which has a strip placed on one of its sides which stores the
digital data
Optical Storage Devices
Such devices used lasers and lights to detect and store data. They are cheaper in comparison to USB drives
and can store more data. Discussed below are a few commonly used optical storage devices.
Page 10 of 19
Fundamentals of Programing & Problem-Solving Unit -I
● CD-ROM - This stands for Compact Disc - Read-Only Memory and is an external device
which can store and read data in the form of audio or software data
● Blu-Ray Disc - Introduced in 2006, Blu-ray disk was backup up by major IT and computer
companies. It can store up to 25 GB data in a single-layer disc and 50 GB data in a dual-
layer disc
● DVD - Digital Versatile Disc is another type of optical storage device. It can be readable,
recordable, and rewritable. Recordings can be done in such devices and then can be attached
to the system
● CD-R - It is a readable Compact Disc which uses photosensitive organic dye to record data
and store it. They are a low-cost replacement for storing software and applications
Flash Memory Devices
These storage devices have now replaced both magnetic and optical storage devices. They are easy to use,
portable and easily available and accessible. They have become a cheaper and more convenient option to
store data. Discussed below are the major flash memory devices which are being commonly used by the
people nowadays.
● USB Drive - Also, known as a pen drive, this storage device is small in size and is portable
and ranges between storage space of 2 GB to 1 TB. It comprises an integrated circuit which
allows it to store data and also replace it
● Memory Card - Usually attached with smaller electronic and computerized devices like
mobile phones or digital camera, a memory card can be used to store images, videos and
audios and is compatible and small in size
● Memory Stick - Originally launched by Sony, a memory stick can store more data and is
easy and quick to transfer data using this storage device. Later on, various other versions of
memory stock were also released
● SD Card - Known as Secure Digital Card, it is used in various electronic devices to store
data and is available in mini and micro sizes. Generally, computers have a separate slot to
insert an SD card. In case they do not have one, separate USBs are available in which these
cards can be inserted and then connected to the computer
Number systems are the technique to represent numbers in the computer system architecture, every value
that you are saving or getting into/from computer memory has a defined number system.
A Binary number system has only two digits that are 0 and 1. Every number (value) represents with 0 and
1 in this number system. The base of binary number system is 2, because it has only two digits.
Page 11 of 19
Fundamentals of Programing & Problem-Solving Unit -I
Octal number system has only eight (8) digits from 0 to 7. Every number (value) represents with
0,1,2,3,4,5,6 and 7 in this number system. The base of octal number system is 8, because it has only 8
digits.
Decimal number system has only ten (10) digits from 0 to 9. Every number (value) represents with
0,1,2,3,4,5,6, 7,8 and 9 in this number system. The base of decimal number system is 10, because it has
only 10 digits.
Represent all types of data in digital systems: Binary codes allow computers to represent
everything from numbers to text, images, and audio by converting data into sequences of 0s and
1s.
Enable fast and accurate processing by computers: Binary codes help computers perform
operations like addition, subtraction, multiplication, and logical functions quickly and efficiently.
Simplify the design of electronic circuits and systems: By using only two states (0 and 1),
binary coding reduces the complexity of circuit design, making it easier to implement and
maintain reliable systems.
Provide efficient data transmission with minimal errors: Binary coding enhances data
transmission efficiency by simplifying signal representation, reducing the likelihood of signal
degradation, and facilitating error detection.
Page 12 of 19
Fundamentals of Programing & Problem-Solving Unit -I
Enable the use of Boolean logic in computing for decision-making: Binary codes work
seamlessly with Boolean logic, allowing computers to make decisions and perform logical
operations, essential for programming and algorithm design.
Make storage and retrieval of data in memory devices more reliable: Binary coding
ensures that data can be stored in a structured, easily retrievable format in memory devices,
ensuring accuracy and consistency over time.
Allow interoperability across various digital devices and platforms: Binary coding is
universally recognized, ensuring compatibility between different devices, systems, and
platforms, enabling seamless communication and data sharing.
Minimize power consumption in digital circuits: Since binary codes use only two states,
they require less energy to switch between these states, resulting in reduced power consumption
in digital circuits.
X. CONVERSION OF NUMBERS
The computer systems accept the data in decimal form, whereas they store and process the data
in binary form. Therefore, it becomes necessary to convert the numbers represented in one
system into the numbers represented in another system.
The different types of number system conversions can be divided into the following major
categories:
Non-decimal to decimal
Decimal to non-decimal
Octal to hexadecimal
Non-Decimal to Decimal
The non-decimal to decimal conversions can be implemented by taking the concept of place
values into consideration. The non-decimal to decimal conversion includes the following
number system conversions:
Page 13 of 19
Fundamentals of Programing & Problem-Solving Unit -I
A binary number can be converted to equivalent decimal number by calculating the sum of
the products of each bit multiplied by its corresponding place value.
Convert the binary number 10101101 into its corresponding decimal number.
Convert the binary number 1011.010 into its equivalent in decimal system
An octal number can be converted into its equivalent number in decimal system by
calculating the sum of the products of each digit multiplied by its corresponding place value.
Convert the octal number 13256 into its equivalent in decimal system
Page 14 of 19
Fundamentals of Programing & Problem-Solving Unit -I
A hexadecimal number can be converted into its equivalent number in decimal system by
calculating the sum of the products of each symbol multiplied by its corresponding place
value.
Convert the hexadecimal number A53 into its equivalent in decimal system.
Decimal to non-decimal
The decimal to non-decimal conversions is carried out by continually dividing the decimal
number by the base of the desired number system till the decimal number becomes zero.
After the decimal number becomes zero, we may note down the remainders calculated at
each successive division from last to first to obtain the decimal number into the desired
system. The decimal to non-decimal conversion includes the following number system
conversions:
The decimal to binary conversion is performed by repeatedly dividing the decimal number by
2 till the decimal number becomes zero and then reading the remainders from last to first to
obtain the binary equivalent of the given decimal number.
Page 15 of 19
Fundamentals of Programing & Problem-Solving Unit -I
The decimal to octal conversion is performed by repeatedly dividing the decimal number by
8 till the decimal number becomes zero and reading the remainders from last to fi rst to
obtain the octal equivalent of the given decimal number.
Convert the decimal number 1567 into its equivalent hexadecimal number
Octal to Hexadecimal
The given octal number can be converted into its equivalent hexadecimal number in two
different steps. Firstly, we need to convert the given octal number into its binary equivalent.
Page 16 of 19
Fundamentals of Programing & Problem-Solving Unit -I
After obtaining the binary equivalent, we need to divide the binary number into 4-bit sections
starting from the LSB. The octal to binary conversion is a simple process. In this type of
conversion, we need to represent each digit in the octal number to its equivalent 3-bit binary
number
Convert the octal number 365 into its equivalent hexadecimal number.
Page 17 of 19
Fundamentals of Programing & Problem-Solving Unit -I
b. UNICODE
The 16-bit Unicode is an International 16-bit character set that contains a maximum of 216 =
65,536 different characters.
These characters are sufficient to represent almost all the technical and special symbols used
by the major languages of the world.
The 16-bit Unicode, (also called 16-bit universal character set), encodes the different
characters by assigning them a unique value. In computer terminology, this unique value is
referred as code point.
The code assigned to each character of different languages is universal and can be used on
any platform without any modification.
Therefore, we can say that the 16-bit Unicode allows the computer systems to deal with
almost all the characters belonging to different languages used in the world.
The 16-bit Unicode is a character code that is supported by almost all the operating systems
such as MS Windows, Linux and Mac OS X. For example, MS Windows operating system
allows the use of all the Unicode characters through an accessory called Character Map.
Using the Character Map window, we can select any of the Unicode character and copy it to
the clipboard. After copying it to the clipboard, we can use the selected Unicode character in
any application running under MS Windows operating system
Page 18 of 19
Fundamentals of Programing & Problem-Solving Unit -I
Page 19 of 19