Comp Fundamentals Unit 1
Comp Fundamentals Unit 1
Unit I [4 T]
a. Machine language:
It is one of the low-level programming languages which is the first generation language
developed for communicating with a Computer. It is written in machine code which represents 0
and 1 binary digits inside the Computer string which makes it easy to understand and perform the
operations. As we know a Computer system can recognize electric signals so here 0 stands for
turning off electric pulse and 1 stands for turning on electric pulse.
It is very easy to understand by the Computer and also increases the processing speed.
The main advantage of using Machine language is that there is no need of a translator or
interpreter to translate the code, as the Computer directly can understand. But there are some
disadvantages also like you have to remember the operation codes, memory address every time
when you write a program and also hard to find errors in a written program.
b. Assembly Language
Between high-level language and machine language there are assembly language also called
symbolic machine code. Assembly languages are particularly computer architecture specific.
Utility program (Assembler) is used to convert assembly code into executable machine code.
High Level Programming Languages are portable but require Interpretation or compiling to
convert it into a machine language which is computer understood.
It is the second generation programming language that has almost similar structure and
set of commands as Machine language. Instead of using numbers like in Machine languages here
we use words or names in English forms and also symbols. The programs that have been written
using words, names and symbols called mnemonics in assembly language are converted to
machine language using an Assembler. Mnemonics gave relief to the programmers from
remembering binary sequence for specific instructions, as English words like ADD, MOV, SUB
are easy to remember, than binary sequence 10001011.
Because a Computer only understands machine code languages that’s why we need an
Assembler that can convert the Assembly level language to Machine language so the Computer
gets the instruction and responds quickly. The main disadvantage of this language is that it is
written only for a single type of CPU and does not run on any other CPU. But its speed makes it
the most used low level language till today which is used by many programmers.
2. Assembler:
The Assembler is used to translate the program written in Assembly language into machine code.
The source program is a input of assembler that contains assembly language instructions. The
output generated by assembler is the object code or machine code understandable by the
computer.
3. Interpreter:
The translation of single statement of source program into machine code is done by language
processor and executes it immediately before moving on to the next line is called an interpreter.
If there is an error in the statement, the interpreter terminates its translating process at that
statement and displays an error message. The interpreter moves on to the next line for execution
only after removal of the error. An Interpreter directly executes instructions written in a
programming or scripting language without previously converting them to an object code or
machine code.
Example: Perl, Python and Matlab.
Difference between Compiler and Interpreter :
Compiler Interpreter
A compiler is a program which coverts the
interpreter takes a source program and runs it
entire source code of a programming
line by line, translating each line as it comes
language into executable machine code for a
to it.
CPU.
Compiler takes large amount of time to
Interpreter takes less amount of time to
analyze the entire source code but the overall
analyze the source code but the overall
execution time of the program is
execution time of the program is slower.
comparatively faster.
Compiler generates the error message only
after scanning the whole program, so Its Debugging is easier as it continues
debugging is comparatively hard as the error translating the program until the error is met
can be present any where in the program.
Generates intermediate object code. No intermediate object code is generated.
Examples: C, C++, Java Examples: Python, Perl
It is also known as IAS machine, the first electronic computer to be built at the Institute for
Advanced Study (IAS) in Princeton, New Jersey. It is also called the von
Neumann machine, and is having three basic units:
1. The Central Processing Unit (CPU)
2. The Main Memory Unit
3. The Input/Output Device
Control Unit : A control unit (CU) handles all processor control signals. It directs all input and
output flow, fetches code for instructions and controlling how data moves around the system.
Arithmetic and Logic Unit (ALU) : The arithmetic logic unit is that part of the CPU that
handles all the calculations the CPU may need, e.g. Addition, Subtraction, Comparisons. It
performs Logical Operations, Bit Shifting Operations, and Arithmetic Operation.
Memory Unit (Registers): A processor register (CPU register) is one of a small set of data
holding places that are part of the computer processor. Registers are made up of flip-flops. A
register may hold an instruction, a storage address, or any kind of binary data. Mostly used
Registers are:
2. Program Counter (PC): Keeps track of the memory location of the next instructions
to be dealt with. The PC then passes this next address to Memory Address Register
(MAR).
4. Memory Data Register (MDR): It stores instructions fetched from memory or any
data that is to be transferred to, and stored in, memory.
5. Current Instruction Register (CIR): It stores the most recently fetched instructions
while it is waiting to be coded and executed.
Input/Output Devices : Program or data is read into main memory from the input device or
secondary storage under the control of CPU input instruction. Output devices are used to
output the information from a computer. If some results are evaluated by computer and it is
stored in the computer, then with the help of output devices, we can present it to the user.
Buses – Data is transmitted from one part of a computer to another, connecting all major
internal components to the CPU and memory, by the means of Buses. Types:
Data Bus: It carries data among the memory unit, the I/O devices, and the processor.
Address Bus: It carries the address of data (not the actual data) between memory and
processor.
Control Bus: It carries control commands from the CPU (and status signals from other
devices) in order to control and coordinate all the activities within the computer.
---------------------------------------------------------------------------------------------------------------------
-----------------------------------
Functional Components of a Computer
Computer: A computer is a combination of hardware and software resources which integrate
together and provides various functionalities to the user. Hardware are the physical components
of a computer like the processor, memory devices, monitor, keyboard etc. while software is the
set of programs or instructions that are required by the hardware resources to function properly.
There are a few basic components that aids the working-cycle of a computer i.e. the Input-
Process- Output Cycle and these are called as the functional components of a computer. It needs
certain input, processes that input and produces the desired output. The input unit takes the input,
the central processing unit does the processing of data and the output unit produces the output.
The memory unit holds the data and instructions during the processing.
Digital Computer: A digital computer can be defined as a programmable machine which reads
the binary data passed as instructions, processes this binary data, and displays a calculated digital
output. Therefore, Digital computers are those that work on the digital data.
Details of Functional Components of a Digital Computer
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 ans 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). Read this for different types of RAMs
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.
Interconnection between Functional Components
A computer consists of input unit that takes input, a CPU that processes the input and an output
unit that produces output. All these devices communicate with each other through a common
bus. A bus is a transmission path, made of a set of conducting wires over which data or
information in the form of electric signals, is passed from one component to another in a
computer. The bus can be of three types – Address bus, Data bus and Control Bus.
Following figure shows the connection of various functional components:
The address bus carries the address location of the data or instruction. The data bus carries data
from one component to another and the control bus carries the control signals. The system bus is
the common communication path that carries signals to/from CPU, main memory and
input/output devices. The input/output devices communicate with the system bus through the
controller circuit which helps in managing various input/output devices attached to the computer.
Memory Hierarchy
In the Computer System Design, Memory Hierarchy is an enhancement to organize the memory
such that it can minimize the access time. The Memory Hierarchy was developed based on a
program behavior known as locality of references. The figure below clearly demonstrates the
different levels of memory hierarchy:
This Memory Hierarchy Design is divided into 2 main types:
Comprising of Magnetic Disk, Optical Disk, and Magnetic Tape, i.e. peripheral storage devices
which are accessible by the processor via I/O devices.
Comprising of Main Memory, Cache Memory & CPU registers. This is directly accessible by the
processor.
We can infer the following characteristics of Memory Hierarchy Design from above figure:
Capacity: It is the global volume of information the memory can store. As we move from top to
bottom in the Hierarchy, the capacity increases.
Access Time: It is the time interval between the read/write request and the availability of the
data. As we move from top to bottom in the Hierarchy, the access time increases.
Performance: Earlier when the computer system was designed without Memory Hierarchy
design, the speed gap increases between the CPU registers and Main Memory due to large
difference in access time. This results in lower performance of the system and thus, enhancement
was required. This enhancement was made in the form of Memory Hierarchy Design because of
which the performance of the system increases. One of the most significant ways to increase
system performance is minimizing how far down the memory hierarchy one has to go to
manipulate data.
Cost per bit: As we move from bottom to top in the Hierarchy, the cost per bit increases i.e.
Internal Memory is costlier than External Memory.
………………………………………………………………………………………………………
………………
Understanding file sizes | Bytes, KB, MB, GB, TB, PB, EB, ZB, YB
Main memory ( RAM , ROM ):
Memory is the most essential element of a computing system because without it computer can’t
perform simple tasks. Computer memory is of two basic type – Primary memory / Volatile
memory and Secondary memory / non-volatile memory. Random Access Memory (RAM) is
volatile memory and Read Only Memory (ROM) is non-volatile memory.
ROM 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 4 types- ROM, PROM, EPROM, and EEPROM.
Types of Read Only Memory (ROM) :
1. PROM (Programmable read-only memory) – It can be programmed by user. Once
programmed, the data and instructions in it cannot be changed.
2. EPROM (Erasable Programmable read only memory) – It can be reprogrammed. To
erase data from it, expose it to ultra violet light. To reprogram it, erase all the previous data.
3. EEPROM (Electrically erasable programmable read only memory) – The data can be
erased by applying electric field, no need of ultra violet light. We can erase only portions of
the chip.
Cache Memory:
Cache Memory is a special very high-speed memory. It is used to speed up and synchronizing
with high-speed CPU. Cache memory is costlier than main memory or disk memory but
economical than CPU registers. Cache memory is an extremely fast memory type that acts as a
buffer between RAM and the CPU. It holds frequently requested data and instructions so that
they are immediately available to the CPU when needed.
Cache memory is used to reduce the average time to access data from the Main memory.
The cache is a smaller and faster memory which stores copies of the data from frequently used
main memory locations. There are various different independent caches in a CPU, which stores
instruction and data.
Cache Performance:
When the processor needs to read or write a location in main memory, it first checks for a
corresponding entry in the cache.
If the processor finds that the memory location is in the cache, a cache hit has occurred
and data is read from cache. If the processor does not find the memory location in the cache,
cache miss has occurred. For a cache miss, the cache allocates a new entry and copies in data
from main memory, and then the request is fulfilled from the contents of the cache.
The disk is divided into tracks. Each track is further divided into sectors.
Hard disk drive components:
Most of the basic types of hard drives contain a number of disk platters that are placed
around a spindle which is placed inside a sealed chamber. The chamber also includes
read/write head and motors. Data is stored on each of these disks in the arrangement of
concentric circles called tracks which are divided further into sectors. Though internal Hard
drives are not very portable and used internally in a computer system, external hard disks can
be used as a substitute for portable storage. Hard disks can store data up to several terabytes.
Read-Write(R-W) head moves over the rotating hard disk. It is this Read-Write head that
performs all the read and write operations on the disk and hence, position of the R-W head is a
major concern. To perform a read or write operation on a memory location, we need to place the
R-W head over that position. Some important terms must be noted here:
Seek time – The time taken by the R-W head to reach the desired track from its current position.
Rotational latency – Time taken by the sector to come under the R-W head.
Data transfer time – Time taken to transfer the required amount of data. It depends upon the
rotational speed.
Controller time – The processing time taken by the controller.
Average Access time = seek time + Average Rotational latency + data transfer time + controller
time.
2. Optical storage media
In optical storage media information is stored and read using a laser beam. The data is stored as a
spiral pattern of pits and ridges denoting binary 0 and binary 1.
Examples: CDs and DVDs
a. Compact Disk: A Compact Disc drive(CDD) is a device that a computer uses to read data
that is encoded digitally on a compact disc(CD). A CD drive can be installed inside a
computer’s compartment, provided with an opening for easier disc tray access or it can be
used by a peripheral device connected to one of the ports provided in the computer system. A
compact disk or CD can store approximately 650 to 700 megabytes of data. A computer
should possess a CD Drive to read the CDs. There are three types of CDs:
b. DVD
It stands for Digital Versatile Disk or Digital Video Disk. It looks just like a CD and use a
similar technology as that of the CDs but allows tracks to be spaced closely enough to store data
that is more than six times the CD’s capacity. It is a significant advancement in portable storage
technology. A DVD holds 4.7 GB to 17 GB of data.
d. Transport Data:
Professionals/Students can now easily transport large data files and video/audio lectures on a pen
drive and gain access to them from anywhere. Independent PC technicians can store work-related
utility tools, various programs and files on a high-speed 64 GB pen drive and move from one site
to another.
-------------------------------------------------------------------------------------------------------------------
Basics of Hardware Components:
This section aims to discuss a selection of hardware parts, outline common metrics and
specifications used to describe them, what they measure as well as their operation.
SMPS (Switched Mode Power Supply): The power supply converts the alternating current
(AC) from your mains (110V input or 220V input) to the direct current (DC) needed by the
computer 2 . In a PC, the power supply is the metal box usually found in a corner of the case.
The power supply is visible from the back of many systems because it contains the power-cord
receptacle and the cooling fan. Power supplies - often referred to as switching power supplies,
use switcher technology to convert the AC input to lower DC voltages. The typical voltages
produced are: 3.3 volts, 5 volts, 12 volts.
The 3.3-volts and 5-volts are typically used by digital circuits, while the 12-volt is used to power
fans and motors in disk drives. The main specification of a power supply is in watts.
Power Supply Wattage: A 400-watt switching power supply will not necessarily use more
power than a 250- watt supply. A larger supply may be needed if you use every available slot on
the motherboard or every available drive bay in the personal computer case. It is not a good idea
to have a 250-watt supply if you have 250 watts total in devices, since the supply should not be
loaded to 100 percent of its capacity. According to PC Power & Cooling, Inc., some power
consumption values (in watts) for common items in a personal computer are:
Component Requirement
AGP Video Card 30W - 50W
PCI Express Video 100W-250W
Average PCI Card 5W - 10W
DVD/CD 20W-30W
Hard Drive 15W-30W
Case/CPU Fans 3W
Motherboard (w/o CPU or RAM) 50W - 150W
RAM 15W per 1GB
Processor 80W - 140W
If you use a PSU that does not supply enough power for the system, any of the following
symptoms might occur: (i) System does not boot, (ii) System randomly shuts down, (iii) Add-
in devices do not work properly. Intel (2014a)
For overall power supply wattage, add the requirement for each device in your system, then
multiply by 1.5. The multiplier takes into account that today’s systems draw disproportionally on
the +12V output. Furthermore, power supplies are more efficient and reliable when loaded to
30% - 70% of maximum capacity.
Motherboard:
The motherboard is the key circuit board holding the essential processing parts of a computer. It
allows all the parts of your computer to receive power and communicate with one another.
The components attached directly to the motherboard are the CPU, RAM, expansion cards,
Networking, video, and audio components.
Random access memory (RAM) is a series of small cards or modules plugged into slots on the
motherboard. The CPU can request any data in RAM. It is then located, opened, and delivered to
the CPU for processing in a few billionths of a second. Since all the contents of RAM are erased
when you turn off the computer, RAM is the temporary or volatile storage location for the
computer.
How Much RAM do you need? :
The amount of RAM actually sitting on memory modules in your computer is your computer’s
physical memory. The memory that your operating system uses is referred to as kernel memory.
To determine how much RAM your computer needs, look at the memory requirements for each
program and add them up. • You need RAM for the operating system, application software, and
data. If your system responds slowly or accesses the hard drive constantly, then you need to add
more RAM
Application Minimum RAM Required
Windows 7 1000 MB
Microsoft Office Professional 2007 256 MB
Internet Explorer 8 128 MB
iTunes 256 MB
Adobe Photoshop Elements 512 MB
Total RAM required to run all programs 2,152 MB or 2.15 GB
simultaneously
BIOS:
The basic input-output system (BIOS) is the first thing you see when you turn on your computer.
The BIOS is special software that interfaces the major hardware components of your computer
with the operating system. It is usually stored on a Flash memory chip on the motherboard
(which has its own battery), but sometimes the chip is another type of ROM
The BIOS software has a number of different roles, but its most important role is to load the
operating system. When you turn on your computer and the microprocessor tries to execute its
first instruction, it has to get that instruction from somewhere. It cannot get it from the operating
system because the operating system is located on a hard disk, and the microprocessor cannot get
to it without some instructions that tell it how. The BIOS provides those instructions.
Some of the other common tasks that the BIOS performs includes:
1. A power-on self-test (POST) for all of the different hardware components in the system to
make sure everything is working properly.
2. Activating other BIOS chips on different cards installed in the computer – e.g. SCSI and
graphics cards often have their own BIOS chips.
3. Providing a set of low-level routines that the operating system uses to interface to different
hardware devices - it is these routines that give the BIOS its name. They manage things like
the keyboard, the screen, and the serial and parallel ports, especially when the computer is
booting.
4. Managing a collection of settings for the hard disks, clock, etc.
Manufacturers: American MegaTrends Inc. (AMI), Phoenix Technologies, Ali, Winbond.
e.g.
When you insert more RAM memory - once the module is installed, close the case, plug the
computer back in and power it up. When the computer starts the POST, it should
automatically recognize the memory.
Ports:
A Computer Port is an interface or a point of connection between the computer and its peripheral
devices. Some of the common peripherals are mouse, keyboard, monitor or display unit, printer,
speaker, flash drive etc.
Serial Port:
Used for external modems and older computer mouse
Two versions: 9 pin, 25 pin model
Data travels at 115 kilobits per second
Parallel Port:
Used for scanners and printers
Also called printer port
25 pin model
IEEE 1284-compliant Centronics port
PS/2 Port:
Used for old computer keyboard and mouse
Also called mouse port
Most of the old computers provide two PS/2 port, each for the mouse and keyboard
IEEE 1284-compliant Centronics port
Universal Serial Bus (or USB) Port:
It can connect all kinds of external USB devices such as external hard disk, printer,
scanner, mouse, keyboard, etc.
It was introduced in 1997.
Most of the computers provide two USB ports as minimum.
Data travels at 12 megabits per seconds.
USB compliant devices can get power from a USB port.
VGA Port:
Connects monitor to a computer's video card.
It has 15 holes.
Similar to the serial port connector. However, serial port connector has pins, VGA port
has holes.
Power Connector:
Three-pronged plug.
Connects to the computer's power cable that plugs into a power bar or wall socket.
Firewire Port:
Transfers large amount of data at very fast speed.
Connects camcorders and video equipment to the computer.
Data travels at 400 to 800 megabits per seconds.
Invented by Apple.
It has three variants: 4-Pin FireWire 400 connector, 6-Pin FireWire 400 connector, and
9-Pin FireWire 800 connector.
Modem Port:
Connects a PC's modem to the telephone network.
Ethernet Port:
Connects to a network and high speed Internet.
Connects the network cable to a computer.
This port resides on an Ethernet Card.
Data travels at 10 megabits to 1000 megabits per seconds depending upon the network
bandwidth.
Game Port:
Connect a joystick to a PC
Now replaced by USB
Digital Video Interface, DVI port:
Connects Flat panel LCD monitor to the computer's high-end video graphic cards.
Very popular among video card manufacturers.
Sockets:
Sockets connect the microphone and speakers to the sound card of the computer.
-------------------------------------------------------------------------------------------------------------
Adapters:
An adapter is a physical device that allows one hardware or electronic interface to be adapted
(accommodated without loss of function) to another hardware or electronic interface. In
a computer, an adapter is often built into a card that can be inserted into a slot on
the computer's motherboard.
Network cables:
Four major types of communications media (cabling) are available for data networking today:
unshielded twisted pair (UTP), shielded or screened twisted pair (STP or ScTP), coaxial,
and fiber optic (FO). It is important to distinguish between backbone cables and horizontal
cables. Backbone cables connect network equipment such as servers, switches, and routers and
connect equipment rooms and communication closets. Horizontal cables run from the
communication closets to the wall outlets. For new installations, multistrand fiber-optic cable is
essentially universal as backbone cable. For the horizontal, UTP reigns supreme
Twisted-Pair Cable :
By far the most economical and widely installed cabling today is twisted-pair wiring. Not only is
twisted-pair wiring less expensive than other media, installation is also simpler, and the tools
required to install it are not as costly. Unshielded twisted pair (UTP) and shielded twisted
pair (STP) are the two primary varieties of twisted pair on the market today. Screened twisted
pair (ScTP) is a variant of STP.
Though it has been used for many years for telephone systems, unshielded twisted pair (UTP) for
LANs first became common in the late 1980s with the advent of Ethernet over twisted-pair
wiring and the 10Base-T standard. UTP is cost effective and simple to install, and its bandwidth
capabilities are continually being improved.
Shielded Twisted Pair (STP):
Shielded twisted-pair (STP) cabling was first made popular by IBM when it introduced Type
classification for data cabling. Though more expensive to purchase and install than UTP, STP
offers some distinct advantages. The current ANSI/TIA/EIA-568-B Cabling Standard recognizes
IBM Type 1A horizontal cable, which supports frequency rates of up to 300MHz, but does not
recommend it for new installations.
Two varieties of fiber-optic cable are commonly used in LANs and WANs today: single mode
and multimode. The mode can be thought of as bundles of light rays entering the fiber; these
light rays enter at certain angles.
Coaxial Cable:
At one time, coaxial cable was the most widely used cable type in the networking business. It is
still widely used for closed-circuit TV and other video distribution. However, it is falling by the
wayside in the data-networking arena. Coaxial (or just coax) cable is difficult to run and is
generally more expensive than twisted-pair cable. In defense of coaxial cable, however, it
provides a tremendous amount of bandwidth and is not as susceptible to outside interference as is
UTP. Overall installation costs might also be lower than for other cable types because the
connectors take less time to apply.
Example: Following are the suggestions for assembling a desktop. There are three types of
configurations depending on your budget: low, mid and high. (Prices of the components may
vary slightly.)
i3 3240 Processor (Rs. 6,720)
ASRock H81 Pro (Rs. 4,000)
Kingston 4GB DDR3 Ram (Rs. 2,220)
Zotac Nvidia 610 2GB (Rs. 3,155)
Low Seagate Pipeline Hard Disk 320GB (Rs. 2,225) Total Cost Rs. 31000
Dell TFT 18.5 Inch (Rs. 5,660)
Corsair VS450 PSU (Rs. 2,525)
Cooler Master Elite 344 Cabinet (Rs. 3,200)
Microsoft Desktop 200 Keyboard Mouse Combo (Rs. 900)