Professional Documents
Culture Documents
Unit 1: Motherboard
Unit 1: Motherboard
A computer is really a system of many parts working together. The physical parts, which you
can see and touch, are collectively called hardware. Software, on the other hand, refers to
the instructions, or programs, that tell the hardware what to do.
Monitor Displays information in visual form, using text and graphics.The portion of the
monitor that displays the information is called the screen. Like a television screen, a
computer screen can show still or moving pictures.There are two basic types of monitors:
CRT (cathode ray tube) monitors and LCD (liquid crystal display) monitors.Both types
produce sharp images, but LCD monitors have the advantage of being much thinner and
lighter. CRT monitors, however, are generally more affordable.
Motherboard Also known as mainboard or logic board Serves to connect all of the parts of
a computer together. The CPU, memory, hard drives, optical drives, video card, sound card
and other ports and expansion cards all connected to the motherboard directly or via
cables.
CentralProcessingUnit
Also called as a processor, microprocessor, central processor, "the brains of the
computer”, the CPU is the heart of any computer system. It interprets and carries out basic
instructions that operate a computer.Central Processing Unit itself consists of three main
subsystems; first is the Control Unit, the second is Registers, and the third is Arithmetic and
Logic Unit(ALU).
Arithmetic Logic Unit (ALU): Arithmetic logic unit (ALU) is a digital circuit that performs
arithmetic and logical operations.An ALU loads data from input registers, an external
Control Unit then tells the ALU what operation to perform on that data, and then the ALU
stores its result into an output register. The Control Unit is responsible for moving the
processed data between these registers, ALU and memory.Arithmetic/logic unit (ALU)
performs execution part of the machine cycle. The execution consists of Arithmetic
(addition, subtraction, multiplication, and division), Comparison (greater than, equal to, or
less than) and Logical (AND, OR, NOT).
Memory
Memory is also known as primary storage, primary memory, main storage, internal storage,
main memory, and RAM (Random Access Memory); all these terms are used
interchangeably by people in computer circles.Memory is the part of the computer that
holds data and instructions for processing. Although closely associated with the central
processing unit, memory is separate from it. Memory stores program instructions or data
for only as long as the program they pertain to is in operation.
L1 cache
L1 cache is a small, fast memory cache that is built in to a CPU and helps speed access to
important and frequently-used data. L1 cache is typically smaller and faster than L2
cache.L1 cache is an abbreviation of Level 1 cache.
Disk Access : P1 P2 P3 P1 P4 P5 P1 P2 P6 P1
RAM is volatile, so data stored in RAM stays there only as long as the computer is
running. As soon as the computer is switched off, the data stored in RAM disappears.
There are two different types of RAM: DRAM (Dynamic Random Access Memory) and
SRAM (Static Random Access Memory).
SRAM (Static Random Access Memory)SRAM is a type of memory that is faster and more
reliable than the more common DRAM (dynamic RAM). The term static is derived from the
fact that it doesn't need to be refreshed like dynamic RAM.Uses multiple transistors,
typically four to six, for each memory cell but doesn't have a capacitor in each cell.It is
volatile i.e. they lose their contents when the power is turned off.It is used primarily for
cache.
DRAM (Dynamic Random Access Memory)It has memory cells with a paired transistor and
capacitor requiring constant refreshing.The advantage of DRAM is its structural simplicity:
only one transistor and a capacitor are required per bit, compared to six transistors in
SRAM. This allows DRAM to reach very high densities.DRAM is used in main memory .
ROM(Read-OnlyMemory)
Read-Only Memory or ROM is an integrated-circuit memory chip that contains configuration
data. ROM is commonly called firmware because its programming is fully embedded into
the ROM chip. As such, ROM is a hardware and software in one. Because data is fully
incorporated at the ROM chip's manufacture, data stored can neither be erased nor
replaced. This means permanent and secure data storage. Data stored in ROM is
nonvolatile - it is not lost when your computer is turned off.Data stored in ROM is
either unchangeable or requires a special operation to change. Examples of ROM are:
Programmable ROM (PROM), Erasable Programmable ROM (EPROM) and Electrically
Erasable Programmable ROM (EEPROM).
Sr.No. Primary memory Secondary memory
Primary memory devices are more Secondary memory devices are less
expensive than secondary storage expensive when compared to primary
4. devices. memory devices.
The memory devices used for primary The secondary memory devices are
5. memory are semiconductor memories. magnetic and optical memories.
Examples: RAM, ROM, Cache memory, Examples: Hard Disk, Floppy Disk,
7. PROM, EPROM, Registers, etc. Magnetic Tapes, etc.
Ports
A port serves as an interface between the computer and other computers or peripheral
devices through which data is sent and received.
Bus
In order for multiple hardware components to communicate with one another, a bus is used
to transmit the data from one part of a computer to another.A bus is a collection of wires
through which data is transmitted from one part of a computer to another.The purpose of
buses is to reduce the number of "pathways" needed for communication between the
components, by carrying out all communications over a single data channel.
Characteristics of a bus
The size of a bus, known as its width, is important because it determines how much data
can be transmitted at one time.For example, a 16-bit bus can transmit 16 bits of data,
whereas a 32-bit bus can transmit 32 bits of data. Additionally, the bus speed is also defined
by its frequency (expressed in Hertz), the number of data packets sent or received per
second.Each time that data is sent or received is called a cycle.
The address bus (sometimes called the memory bus) transports memory addresses
which the processor wants to access in order to read or write data. It is a
unidirectional bus.
The data bus transfers instructions coming from or going to the processor. It is a
bidirectional bus.
The control bus (or command bus) transports orders and synchronisation signals
coming from the control unit and travelling to all other hardware components. It is a
bidirectional bus, as it also transmits response signals from the hardware.
Peripheral Devices
Peripheral devices are computer devices that are connected to the computer externally
such as printer, scanner, keyboard, mouse, tape device, microphone and external modem
or internally such as CD-ROM or internal modem and external as the scanner, printer and
Zip drive. Peripheral devices can be classified according to their functions.
Input devices are the type of the computer devices that are used to provide the control
signals to the computer. Keyboard and the Mouse are the examples of the input devices.
Output devices are the devices that are used to display the results. Printer, scanner,
speaker and the monitor are the examples of the output devices.
Storage: A storage device is a device that is used to store the information such as hard disk
drive, flash drive, floppy disk and the tape drive.
OPERATING SYSTEM
An operating system acts as an intermediary between the user of a computer and computer
hardware. The purpose of an operating system is to provide an environment in which a user
can execute programs conveniently and efficiently. BOOT LOADER
Importance of OS
Types of Booting
1. ColdBooting/SwitchBooting
When the user starts computer by pressing power switch on system unit, the
operating system is loaded from disk to main memory this type of booting is
called Cold Booting. This booting takes more time than Hot or Warm Booting.
2. HotorWarmBooting
Hot booting is done when computer system comes to no response state/hang state.
Computer does not respond to commands supplied by user. There are many
reasons for this state, only solution is to reboot computer by using the Reset
button on cabinet or by pressing a combination of ALT + CTRL + DEL keys from
keyboard.
LANGUAGE PROCESSORS
Compiler
The language processor that reads the complete source program written in high-level
language as a whole in one go and translates it into an equivalent program in machine
language is called a Compiler. Example: C, C++, C#, Java.
In a compiler, the source code is translated to object code successfully if it is free of errors.
The compiler specifies the errors at the end of the compilation with line numbers when
there are any errors in the source code.
Assembler
The Assembler is used to translate the program written in Assembly language into machine
code. The source program is an input of an assembler that contains assembly language
instructions. The output generated by the assembler is the object code or machine code
understandable by the computer. We need an Assembler to fill the gap between human and
machine so that they can communicate with each other.
MOV R1,5
Interpreter
The translation of a single statement of the source program into machine code is done by a
language processor and executes 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 the 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.
Compiler Interpreter
generated.
PROGRAMMING ENVIRONMENT
input.
Variable Declaration
type variable_name;
or for multiple variables:
type variable1_name, variable2_name, variable3_name;
Variable declaration refers to the part where a variable is first declared or
introduced before its first use. Variable definition is the part where the
variable is assigned a memory location and a value.
Variable Naming Convention
A variable name can consist of alphabets (both upper and lower case),
numbers and the underscore ‘_’ character.
Rules for defining variables
1. A variable can have alphabets, digits, and underscore.
2. A variable name can start with the alphabet, and underscore only. It
can’t start with a digit.
3. No whitespace is allowed within the variable name.
4. A variable name must not be any reserved word or keyword, e.g.
int, goto , etc.
Type Casting
A type cast is basically a conversion from one type to another. There are two
types of type conversion:
1. Implicit Type Conversion
Also known as ‘automatic type conversion’.
Done by the compiler on its own, without any external
trigger from the user.
Generally, takes place when in an expression more than
one data type is present. In such condition type
conversion (type promotion) takes place to avoid loss of
data.
All the data types of the variables are upgraded to the
data type of the variable with largest data type.
Example of Type Implicit Conversion:
Types of Variables in C
1. Local Variable
A variable that is declared and used inside the function or block is
called local variable. It’s scope is limited to function or block. It cannot
be used outside the block.
2. Global Variable
A variable that is declared outside the function or block is called a
global variable. It is declared at the starting of program. It is available
to all the functions.
3. Static Variable
A variable that retains its value between multiple function calls is
known as static variable. It is declared with the static keyword.
4. Automatic Variable
All variables in C that are declared inside the block, are automatic
variables by default. We can explicitly declare an automatic variable
using auto keyword.Automatic variables are similar as local variables.
5. External Variable
External variable can be shared between multiple C files.We can
declare external variable using extern keyword.
Data Types in C
Each variable in C has an associated data type. Each data type
requires different amounts of memory and has some specific
operations which can be performed over it.Some very common data
types used in C:
char: The most basic data type in C. It stores a single character
and requires a single byte of memory in almost all compilers.
int: As the name suggests, an int variable is used to store an
integer.
float: It is used to store decimal numbers (numbers with floating
point value) with single precision.
double: It is used to store decimal numbers (numbers with floating
point value) with double precision.
Different data types also have different ranges upto which they can
store numbers. These ranges may vary from compiler to compiler.
Below is list of ranges along with the memory requirement and format
specifiers on 32 bit gcc compiler.
Memory Format
Data Type (bytes) Range Specifier
unsigned
short int 2 0 to 65,535 %hu
-2,147,483,648 to
int 4 2,147,483,647 %d
-2,147,483,648 to
long int 4 2,147,483,647 %ld
unsigned
long int 4 0 to 4,294,967,295 %lu
unsigned 0 to
long long int 8 18,446,744,073,709,551,615 %llu
unsigned
char 1 0 to 255 %c
float 4 %f
double 8 %lf
#include<stdio.h>
void main()
{
int n = 9, div = 0;
// wrong logic
// number is divided by 0,
// so this program abnormally terminates
div = n/0;
printf("result = %d", div);
}