Beruflich Dokumente
Kultur Dokumente
What is a Computer?
Computer is an electronic device that manipulates information or data. It has the ability to store,
retrieve and process the data. You can use a computer to type documents, send email, and surf the
Internet. You can also use it to handle spreadsheets, accounting, database management,
presentations, games and more.
A computer is composed of hardware and software, and can exist in a variety of sizes and
configurations
The term hardware refers to the physical components of your computer such as the system unit, mouse,
keyboard, monitor etc.
The software is the set of instructions that make the computer work. Software is held either on your
computers hard disk, CD-ROM, DVD or on a diskette (floppy disk) and is loaded (i.e. copied) from
the disk into the computers RAM (Random Access Memory), as and when required.
1. With a neat schematic block diagram of a digital computer describe its functional units.
Input Unit: Input unit is used to input some sort of data into the computer. Computers accept coded information
through input units, which read data. It converts the data into a suitable form that can be understood
by the Computer.
The converted data is stored in the form of 0s and 1s and then sent to Central processing unit
The user can also interact with other devices such as CPU, MU and output unit
Examples:
A keyboard is an input device that inputs characters.
Many other kinds of input devices are available, including joysticks, trackballs, and mouse, which
can be used as pointing device.
Touch screens are often used as graphic input devices in conjunction with displays.
Unit-1
Microphones can be used to capture audio input which is then sampled and converted into digital
codes for storage and. processing. Cameras and scanners are used as to get digital images.
Output unit: Its main function is to send processed results to the outside world that is used to display the
processed results.
Accepts the result or data from memory which are in the form of 0s and 1s.
Output the results or data to a form which is suitable for human understanding.
Examples :
Video terminals and graphic displays.
The most familiar example of such a device is a printer. Printers employ mechanical impact heads,
ink-jet streams, or photocopying techniques, as in laser printers, to perform the printing.
Monitors, Speakers, Headphones and projectors are also some of the output devices.
Storage devices such as hard disk, floppy disk, flash drives are also used for input as well as output.
Central Processing Unit; The central processing unit (CPU) of a computer is a hardware device that executes all the
instructions of a computer program.
It performs basic arithmetical, logical, and input/output operations of a computer system.
This is the unit through which the computer processes all the data accepted through the input unit.
It consists of two functional units: 1. Arithmetic and Logic Unit (ALU)
2. Control Unit (CU)
1. Arithmetic and Logic Unit (ALU);o An ALU consists of electronic circuitry which performs calculations with basic arithmetic
operations such as addition (+), subtraction (-), multiplication (*), division (/).
o It also consists of logic circuitry which performs logic operations like true or false, yes or no.
2. Control Unit (CU):o The control unit is a component of a computer's central processing unit (CPU) which directs
operation of the processor.
o It controls communication and co-ordination between input/output devices.
o It reads and interprets instructions and determines the sequence for processing the data.
o It performs the tasks of fetching, decoding, managing execution and, finally, storing results
o The control unit is the circuitry that controls the flow of data through the processor, and coordinates
the activities of the other units within it.
Memory Unit (MU):The Term Computer Memory is defined as one or more sets of chips that store Data/program
instructions, either temporarily or permanently.
Two types of memory units:
1. Primary Memory or Main Memory
2. Secondary Memory
1. Main Memory / Primary Memory unit:
RAM(Random Access Memory)
Unit-1
RAM or Random Access Memory is the central storage unit in a computer system. It is the place in a
computer where the operating system, application programs and the data in current use are kept temporarily
so that they can be accessed by the computers processor. The more RAM a computer has, the more data a
computer can manipulate.
Random access memory, also called the Read/Write memory, is the temporary memory of a
computer. It is said to be volatile since its contents are accessible only as long as the computer is on. The
contents of RAM are cleared once the computer is turned off.
ROM(Read-only Memory)
ROM or Read Only Memory is a special type of memory which can only be read and contents of which are
not lost even when the computer is switched off. It typically contains manufacturers instructions. Among
other things, ROM also stores an initial program called the bootstrap loader whose function is to start the
computer software operating, once the power is turned on.
Read-only memories can be manufacturer-programmed or user-programmed. While manufacturerprogrammed ROMs have data burnt into the circuitry, user-programmed ROMs can have the user load and
then store read-only programs. PROM or Programmable ROM is the name given to such ROMs.
Information once stored on the ROM or PROM chip cannot be altered. However, another type of
memory called EPROM (Erasable PROM) allows a user to erase the information stored on the chip and
reprogram it with new information. EEPROM (Electrically EPROM) and UVEPROM (Ultra Violet
EPROM) are two types of EPROMs.
CPU Registers
A register is a very small amount of very fast memory that is built into the CPU. All data must be
represented in a register before it can be processed.
For example, if two numbers are to be multiplied, both numbers must be in registers, and the result is
also placed in a register.
A processor often contains several kinds of registers such as
data registers: can hold numeric values such as integer and, floating-point values, as well as
characters, small bit arrays and other data.
address registers : hold addresses and are used by instructions that indirectly access primary
memory.
instruction register : holding the instruction currently being executed.
Constant registers hold read-only values such as zero, one, or pi. AND SO ON
Cache memory:
Its a high speed memory and is placed between CPU and main memory.
The data and instructions stored in it are accessed at a higher speed
Users cannot access this memory
It stores data and instructions that are currently to be executed.
2. Secondary Memory:
Unit-1
It is the permanent memory which stores large amount of data and instructions permanently.
Its also called back up memory or auxiliary memory.
It is connected to CPU and is made of magnetic material. It is much cheaper than the main storage.
Secondary memory is a non volatile memory.
Non volatile memory: The memory that retains its contents permanently even after the computer is
turned off. They hold the data permanently.
E.g. Floppy disc, hard disc, CD.
2. Discrete Components of a Computer
The term computer is used to describe a device made up of electronic and electro mechanical components
Motherboard:
A motherboard is one of the most essential parts of a computer system. It holds together many
of the crucial components of a computer, including the central processing unit (CPU), memory and
connectors for input and output devices. The base of a motherboard consists of a very firm sheet of nonconductive material, typically some sort of rigid plastic. Thin layers of copper or aluminum foil, referred to
as traces, are printed onto this sheet. These traces are very narrow and form the circuits between the various
components. In addition to circuits, a motherboard contains a number of sockets and slots to connect the
other components.
FIG: MOTHERBOARD
Processor:
A processor is the logic circuitry that responds to and processes the basic instructions that drives a computer.
The processor reads the commands from the memory and then executes them. The processor is one of the
most expensive parts of the computers and is also one of the smallest parts.
MEMORY DEVICES:
Unit-1
Unit-1
checks and tests before allowing the system to start. If the tests are successful, the power supply sends a
special signal to the motherboard called Power_Good.
If this signal is not present continuously, the computer does not run. Therefore, when the AC voltage dips
and the power supply becomes stressed or overheated, the Power_Good signal goes down and forces a
system reset or complete shutdown.
BIOS:
BIOS stands for Basic input and Output system. BIOS is a chip located on all motherboards that
contain instructions and setup for how your system should boot and how it operates.
The four main functions of BIOS
POST - Test the computer hardware and make sure no errors exist before loading the operating
system.
Bootstrap Loader: A Boot loader is the first program (stored in ROM) which executes (before the
main program) whenever a system is initialized. It is used to bootstrap a computer. The term boot is used to
describe the process taken by the computer when turned on that loads the operating system and prepares the
system for use.
BIOS drivers - Low level drivers that give the computer basic operational control over your
computer's hardware.
BIOS or CMOS Setup - Configuration program that allows you to configure hardware settings
including system settings such as computer passwords, time, and date.
CMOS battery:
CMOS (complementary metal-oxide-semiconductor) is the term usually used to describe the small
amount of memory on a computer motherboard that stores the BIOS settings.
It stores information such as the system time and date and the system hardware settings for your
computer. The standard lifetime of a CMOS battery is around 10 Years.
Peripheral Devices:
Any external device, which is not necessary to perform the basic operation of computer, is called as
peripherals. They provide additional computing capabilities. For ex: Printers, Modems, and Speakers etc.
Modem:
Modem (Modulator and Demodulator) is typically used to send digital data over a phone line. The
sending modem converts digital data into analog data, which can be transmitted over telephone lines, and the
receiving modem converts the analog data back into digital form. This is used to connect to Internet.
Unit-1
Printers
It is a device that must be connected to a computer which allows a user to print items on paper, such as
letters and pictures.
It can also work with digital cameras to print directly without the use of a computer.
Different types of printers are 1) Laser 2) Inkjet 3) Dot-Matrix.
3. Computer Networks:
What is Network?
A network consists of two or more computers that are linked (connected) together in order to share
resources (such as printers and CDs), exchange files, or allow electronic communications.
The computers on a network may be linked through cables, telephone lines, radio waves, Satellites,
or infrared light beams.
The physical topology of a network refers to the configuration of cables, computers, and other
peripherals
Different Types of Topologies:
Bus Topology
Star Topology
Ring Topology
Mesh Topology
Tree Topology
Hybrid Topology
Bus Topology:
Bus Topology is the simplest of network topologies. In this type of topology, all the nodes (computers as
well as servers) are connected to the single cable (called bus), by the help of interface connectors. This
central cable is the backbone of the network and is known as Bus (thus the name). Every workstation
communicates with the other device through this Bus.
A signal from the source is broadcasted and it travels to all workstations connected to bus cable. Although
the message is broadcasted but only the intended recipient, whose MAC address or IP address matches,
accepts it. If the MAC /IP address of machine doesnt match with the intended address, machine discards the
signal.
Unit-1
A terminator is added at ends of the central cable, to prevent bouncing of signals. A barrel connector can be
used to extend it. Below I have given a basic diagram of a bus topology and then have discussed advantages
and disadvantages of Bus Network Topology
Bus topologies use coaxial cable.
Ring Topology:
Ring topology is a computer network configuration where the devices are connected to each other in a
circular shape. In a ring network, every device has exactly two neighbors for communication purposes.
Data travels around the network, in one direction. Sending and receiving of data takes place by the help
of TOKEN.
Unit-1
Token contains a piece of information which along with data is sent by the source computer. This token
then passes to next node, which checks if the signal is intended to it. If yes, it receives it and passes the
empty token into the network, otherwise passes token along with the data to next node. This process
continues until the signal reaches its intended destination.
The nodes with token are the ones only allowed to send data. Other nodes have to wait for an empty
token to reach them. This network is usually found in offices, schools and small buildings.
This type of network topology is very organized. Each node gets to send the data when it receives an
empty token. This helps to reduces chances of collision. Also in ring topology all the traffic flows in
only one direction at very high speed.
Even when the load on the network increases, its performance is better than that of Bus topology.
There is no need for network server to control the connectivity between workstations.
Additional components do not affect the performance of network.
Each computer has equal access to resources.
In a star network, each node (file server, workstations, and peripherals) is connected to a central device
called a hub.
The hub takes a signal that comes from any node and passes it along to all the other nodes in the
network.
Data on a star network passes through the hub, switch, or concentrator before continuing to its
destination.
The hub, switch, or concentrator manages and controls all functions of the network.
The star topology reduces the chance of network failure by connecting all of the systems to a central
node.
Unit-1
A tree topology (hierarchical topology) can be viewed as a collection of star networks arranged in a
hierarchy.
This tree has individual peripheral nodes which are required to transmit to and receive from one other
only and are not required to act as repeaters or regenerators.
The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control
and easier troubleshooting.
This is particularly helpful for colleges, universities and schools so that each of the connect to the big
network in some way.
Unit-1
All the computers have access to the larger and their immediate networks.
Disadvantages of a Tree Topology
Overall length of each segment is limited by the type of cabling used.
If the backbone line breaks, the entire segment goes down.
More difficult to configure and wire than other topologies.
Mesh Topology:
In this topology, each node is connected to every other node in the network.
Implementing the mesh topology is expensive and difficult.
In this type of network, each node may send message to destination through multiple paths.
While the data is travelling on the Mesh Network it is automatically configured to reach the destination by
taking the shortest route which means the least number of hops.
Unit-1
A LAN is a network that is used for communicating among computer devices, usually within an office
building or home.
LANs enable the sharing of resources such as files or hardware devices that may be needed by
multiple users.
Is limited in size, typically spanning a few hundred meters, and not more than a mile.
LANs can be either wired or wireless. Twisted pair, coaxial or fibre optic cable can be used in wired
LANs.
Every LAN uses a protocol a set of rules that governs how packets are configured and transmitted.
Unit-1
Bus
Ring
Star
LANs are capable of very high transmission rates (100s Mb/s to G b/s).
Advantages of LAN
Workstations can share peripheral devices like printers. This is cheaper than buying a printer for
every workstation.
User can save their work centrally on the networks file server. This means that they can retrieve their
work from any workstation on the network.
They dont need to go back to the same workstation all the time.
Users can communicate with each other and transfer data between workstations very easily.
One copy of each application package such as a word processor, spreadsheet etc. can be loaded onto
the file and shared by all users.
When a new version comes out, it only has to be loaded onto the server instead of onto every
workstation.
Disadvantages of LAN
Special security measures are needed to stop users from using programs and data that they should
not have access to;
Networks are difficult to set up and need to be maintained by skilled technicians.
If the file server develops a serious fault, all the users are affected, rather than just one user in the
case of a stand-alone machine.
Metropolitan Area Network (MAN):
A metropolitan area network (MAN) is a large computer network that usually spans a city or a
large campus.
A MAN is optimized for a larger geographical area than a LAN, ranging from several blocks of
buildings to entire cities.
A MAN might be owned and operated by a single organization, but it usually will be used by many
individuals and organizations.
A MAN often acts as a high speed network to allow sharing of regional resources.
Unit-1
Examples of MAN: Telephone company network that provides a high speed DSL to customers and
cable TV network.
Advantages of MANs
The biggest advantage of MANs is the bandwidth (potential speed) of the connecting links. This means that
resources (such as databases and files) shared on the network can be accessed extremely quickly.
Disadvantages of MANs
The key disadvantage of MANs is the cost of the cutting-edge technology employed. Also, this equipment
generally has to be installed for the first time, as the copper traditionally used for the phone network is
generally considered to be too slow to be annexed for this purpose.
Unit-1
Advantages of WAN:
Messages can be sent very quickly to anyone else on the network. These messages can have pictures,
sounds, or data included with them (called attachments).
Expensive things (such as printers or phone lines to the internet) can be shared by all the computers
on the network without having to buy a different peripheral for each computer.
Everyone on the network can use the same data. This avoids problems where some users may have
older information than others.
Share information/files over a larger area
Disadvantages of WAN
Setting up a network can be an expensive and complicated experience. The bigger the network the
more expensive it is.
Security is a real issue when many different people have the ability to use information from other
computers. Protection against hackers and viruses adds more complexity and expense.
Once set up, maintaining a network is a full-time job which requires network supervisors and
technicians to be employed.
Information may not meet local needs or interests.
Vulnerable to hackers or other outside threats
Unit-1
Client/server networks are more suitable for larger networks. A central computer, or 'server', acts as the
storage location for files and applications shared on the network. Usually the server is a higher than average
performance computer. The server also controls the network access of the other computers which are
referred to as the 'client' computers. Typically, teachers and students in a school will use the client computers
for their work and only the network administrator (usually a designated staff member) will have access rights
to the server.
Unit-1
4. Networking Components:
Network Interface Card (NIC):
A network interface card (NIC) is a circuit board or card that is installed in a computer so that it can be
connected to a network.
Each computer in a network has a special expansion card, called a network interface card(NIC). The NIC
prepares (formats) and sends data, receives data, and controls data flow between the computer and the
network. On the transmit side, the NIC passes frames of data on to the physical layer, which transmits the
data to the physical link. On the receiver's side, the NIC processes bits received from the physical layer and
processes the message based on its contents.
Hub:
Hub is a device that splits a network connection into multiple computers. It is like a distribution
center. When a computer request information from a network or a specific computer, it sends the request to
the hub through a cable. The hub will receive the request and transmit it to the entire network (every
computer in the network including the originating computer). Most of the computers on the network will
ignore the request. The computer that the request is being sent to will accept the data packet and send out a
reply packet. The reply packet will then be sent to every computer by the hub.
One problem with hubs is that they often cause collisions between packets. As a result, data is lost in
transmission and must be re-sent.
SWITCH:
A network switch is a small hardware device that joins multiple computers together within one local
area network (LAN).
A switch is a telecommunication device that receives a message from any device connected to it and
then transmits the message only to the device for which the message was meant ( It dont broadcast the
received message to entire network). This makes the switch a more intelligent device than a hub (which
receives a message and then transmits it to all the other devices on its network).
Unit-1
Switches appear nearly identical to hubs, but a switch generally contains more intelligence (and a slightly
higher price tag) than a hub.
Unlike hubs, network switches are capable of inspecting data packets as they are received,
determining the source and destination device of each packet, and forwarding them appropriately.
Unlike hubs, switches can limit the traffic to and from each port so that each device connected to the
switch has a sufficient amount of bandwidth. You can think of a switch as a "smart hub." Switches are more
advanced than hubs and less capable than routers.
ROUTER :
A router is a device that joins two different networks together. A router is a device that forwards
data packets between computer networks
A router is connected to two or more data lines from different networks. When a data packet comes in
one of the lines, the router reads the address information in the packet to determine its ultimate destination.
Then, using information in its routing table, it directs the packet to the next network on its journey. Routers
perform the "traffic directing" functions on the Internet. A data packet is typically forwarded from one router
to another through the networks that constitute the internetwork until it reaches its destination.
MODEM :
A modem, short for modulator/demodulator, is a device that converts the digital signals generated by a
computer into analog signals that can travel over conventional phone lines. The modem at the receiving end
converts the analog signal back into a digital form that the computer can understand. This is used to connect
the Internet.
A modem is a device that allows you to connect to your Internet service provider and browse the
Internet. Because modems only provide one IP address each, the best way to use a high-speed modem is to
share its services among computers.
Unit-1
ETHERNET CABLE :
To set up a wired network, Ethernet cables are needed that allow the transmission of
data from one networked device to another. Category 5 (Cat 5) cable is one of the most
common types of Ethernet cable. When connecting computers to a network, one end of the
Cat 5 cable is plugged into the computers NIC and the other is plugged into the hub, switch,
or router.
REPEATERS :
A repeater is a network device that is used to regenerate signals (strength) that are weakened or distorted by
transmission over long distances and through areas with high levels of electromagnetic interference (EMI).
The purpose of a repeater is to extend the LAN segment beyond its physical limits (e.g. Ethernet is 500m for
10Base5).
It is a simple hardware device that moves all packets from one local area network segment to another. The
main purpose of a repeater is to extend the length of the network transmission medium beyond the normal
maximum cable lengths.
Unlike bridges and switches, repeaters do not have physical addresses on the network.
BRIDGES:
A bridge is used to join two network segments together; it allows computers on either segment to
access resources on the other. They can also be used to divide large networks into smaller segments. Bridges
have all the features of repeaters, but can have more nodes, and since the network is divided, there is fewer
computers competing for resources on each segment thus improving network performance.
Bridges can also connect networks that run at different speeds, different topologies, or different
protocols. But they cannot, join an Ethernet segment with a Token Ring segment, because these use different
networking standards. Bridges operate at both the Physical Layer and the MAC sublayer of the Data Link
Unit-1
layer. Bridges read the MAC header of each frame to determine on which side of the bridge the destination
device is located, the bridge then repeats the transmission to the segment where the device is located.
Access points act as wireless hubs to link multiple wireless NICs into a single subnet. Access points also
have at least one fixed Ethernet port to allow the wireless network to be bridged to a traditional wired
Ethernet network.
5. Number Systems:
Human beings use decimal (base 10) and duodecimal (base 12) number systems for counting and
measurements (probably because we have 10 fingers and two big toes). Computers use binary (base 2)
number system, as they are made from binary digital components (known as transistors) operating in two
states - on and off. In computing, we also use hexadecimal (base 16) or octal (base 8) number systems, as a
compact form for represent binary numbers.
1. Decimal (Base 10) Number System
Decimal number system has ten symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9, called digits. It uses positional
notation. That is, the least-significant digit (right-most digit) is of the order of 10^0 (units or ones), the
second right-most digit is of the order of 10^1 (tens), the third right-most digit is of the order of 10^2
(hundreds), and so on. For example,
735 = 7102 + 3101 + 5100
We shall denote a decimal number with an optional suffix D if ambiguity arises.
2. Binary (Base 2) Number System
Binary number system has two symbols: 0 and 1, called bits. It is also a positional notation, for example,
10110B = 124 + 023 + 122 + 121 + 020
Unit-1
We shall denote a binary number with a suffix B. Some programming languages denote binary numbers with
prefix 0b (e.g., 0b1001000), or prefix b with the bits quoted (e.g., b'10001111').
A binary digit is called a bit. Eight bits is called a byte (why 8-bit unit? Probably because 8=23).
3. Hexadecimal (Base 16) Number System
Hexadecimal number system uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F, called hex
digits. It is a positional notation, for example,
A3EH = 1016^2 + 316^1 + 1416^0
We shall denote a hexadecimal number (in short, hex) with a suffix H. Some programming languages denote
hex numbers with prefix 0x (e.g., 0x1A3C5F), or prefix x with hex digit quoted (e.g., x'C3A4D98B').
Each hexadecimal digit is also called a hex digit. Most programming languages accept lowercase 'a' to
'f' as well as uppercase 'A' to 'F'.
4. Conversion from Hexadecimal to Binary
Replace each hex digit by the 4 equivalent bits, for examples,
A3C5H = 1010 0011 1100 0101B
102AH = 0001 0000 0010 1010B
5. Conversion from Binary to Hexadecimal
Starting from the right-most bit (least-significant bit), replace each group of 4 bits by the equivalent hex digit
(pad the left-most bits with zero if necessary), for examples,
1001001010B = 0010 0100 1010B = 24AH
10001011001011B = 0010 0010 1100 1011B = 22CBH
It is important to note that hexadecimal number provides a compact form or shorthand for representing
binary bits.
6. Conversion from Base r to Decimal (Base 10)
Given a n-digit base r number: (dn-1 dn-2 dn-3 ... d3 d2 d1 d0) (base r), the decimal
equivalent is given by:
dn-1 r(n-1) + dn-2 r(n-2) + ... + d1 r1 + d0 r0
7. Conversion from Decimal (Base 10) to Base r
Use repeated division/remainder. For example,
To convert 261D to hexadecimal:
261/16 quotient=16 remainder=5
Unit-1
INTRODUCTION ON BINARY:
Bits:
The smallest "unit" of data on a binary computer is a single bit. Since a single bit is capable of
representing only two different values (typically zero or one) you may get the impression that there are a
very small number of items you can represent with a single bit. Not true! There are an infinite number of
items you can represent with a single bit.
Nibbles:
A nibble is a collection of four bits.
It wouldn't be a particularly interesting data structure except for two items: BCD (binary coded decimal)
numbers and hexadecimal numbers. It takes four bits to represent a single BCD or hexadecimal digit.
With a nibble, we can represent up to 16 distinct values. In the case of hexadecimal numbers, the values 0, 1,
2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F are represented with four bits. BCD uses ten different digits (0, 1, 2,
3, 4, 5, 6, 7, 8, and 9) and requires four bits. In fact, any sixteen distinct values can be represented with a
nibble, but hexadecimal and BCD digits are the primary items we can represent with a single nibble.
Bytes:
Without question, the most important data structure used by the 80x86 microprocessor is the byte.
A byte consists of eight bits and is the smallest addressable datum (data item) on the 80x86
microprocessor. Main memory and I/O addresses on the 80x86 are all byte addresses. This means that the
smallest item that can be individually accessed by an 80x86 programs is an eight-bit value. To access
Unit-1
anything smaller requires that you read the byte containing the data and mask out the unwanted bits. The bits
in a byte are normally numbered from zero to seven using the convention shown below:
Bit 0 is the low order bit or least significant bit; Bit 7 is the high order bit or most significant bit of the
byte. We'll refer to all other bits by their number.
Note that a byte also contains exactly two nibbles:
Bits 0..3 comprise the low order nibble, bits 4.7 form the high order nibble. Since a byte contains
exactly two nibbles, byte values require two hexadecimal digits.
Since a byte contains eight bits, it can represent 28, or 256, different values. Generally, we'll use a byte to
represent numeric values in the range 0...255, signed numbers in the range -128...+127 (see "Signed and
Unsigned Numbers" ), ASCII/IBM character codes, and other special data types requiring no more than 256
different values. Many data types have fewer than 256 items so eight bits is usually sufficient.
Words:
A word is a group of 16 bits. We'll number the bits in a word starting from zero on up to fifteen. The bit
numbering appears below:
Like the byte, bit 0 is the low order bit and bit 15 is the high order bit. When referencing the other bits in a
word use their bit position number.
Notice that a word contains exactly two bytes. Bits 0 through 7 form the low order byte, bits 8 through 15
form the high order byte:
With 16 bits, you can represent 216 (65,536) different values. These could be the values in the range
0..65,535 (or, as is usually the case, -32,768..+32,767) or any other data type with no more than 65,536
values. The three major uses for words are integer values, offsets, and segment values.
Words can represent integer values in the range 0...65,535 or -32,76832,767. Unsigned numeric
values are represented by the binary value corresponding to the bits in the word. Signed numeric values use
Unit-1
the two's complement form for numeric values. Segment values, which are always 16 bits long, constitute
the paragraph address of a code, data, extra, or stack segment in memory.
Double Words:
A double word is exactly what its name implies, a pair of words. Therefore, a double word quantity is 32 bits
long as shown below:
Naturally, this double word can be divided into a high order word and a low order word, or four different
bytes, or eight different nibbles.
Double words can represent all kinds of different things. First and foremost on the list is a segmented
address. Another common item represented with a double word is a 32-bit integer value (which
allows unsigned numbers in the range 0...4,294,967,295 or signed numbers in the range
-2,147,483,648...2,147,483,647). 32-bit floating point values also fit into a double word. Most of
the time, we'll use double words to hold segmented addresses
1. Unsigned Integers :
Unit-1
Unsigned integers can represent zero and positive integers, but not negative integers.
The value of an unsigned integer is interpreted as "the magnitude of its underlying binary pattern".
Range: An unsigned integer containing n bits can have a value between 0 and 2n 1.
Example 1:
Suppose that n=8 and the binary pattern is 0100 0001B, the value of this unsigned integer is 120 +
126 = 65D.
Example 2:
Suppose that n=16 and the binary pattern is 0001 0000 0000 1000B, the value of this unsigned
integer is 123 + 1212 = 4104D.
Example 3:
Suppose that n=16 and the binary pattern is 0000 0000 0000 0000B, the value of this unsigned
integer is 0.
An n-bit pattern can represent 2n distinct integers. An n-bit unsigned integer can represent integers from 0 to
(2n)-1, as tabulated below:
N(decimal
number)
8
16
32
64
Minimum
Maximum
0
0
0
0
(28)-1 (=255)
(216)-1 (=65,535)
(232)-1 (=4,294,967,295) (9+ digits)
(264)-1 (=18,446,744,073,709,551,615) (19+ digits)
2. Signed Integers:
Signed integers can represent zero, positive integers, as well as negative integers. Three representation
schemes are available for signed integers:
1. Sign-Magnitude representation
2. 1's Complement representation
3. 2's Complement representation
In all the above three schemes, the most-significant bit (msb) is called the sign bit. The sign bit is used to
represent the sign of the integer - with 0 for positive integers and 1 for negative integers. The magnitude of
the integer, however, is interpreted differently in different schemes.
Unit-1
The most-significant bit (msb) is the sign bit, with value of 0 representing positive integer and 1
representing negative integer.
The remaining n-1 bits represent the magnitude (absolute value) of the integer. The absolute value of
the integer is interpreted as "the magnitude of the (n-1)-bit binary pattern".
The largest and smallest signed integer that can be represented by using Signed Magnitude method of
N bits is
(2(N 1) 1) to 2(N 1) 1
Example 1: Suppose that n=8 and the binary representation is 0 100 0001B.
Sign bit is 0 positive
Absolute value is 100 0001B = 65D
Hence, the integer is +65D
Example 2: Suppose that n=8 and the binary representation is 1 000 0001B.
Sign bit is 1 negative
Absolute value is 000 0001B = 1D
Hence, the integer is -1D
Example 3: Suppose that n=8 and the binary representation is 0 000 0000B.
Sign bit is 0 positive
Absolute value is 000 0000B = 0D
Hence, the integer is +0D
Example 4: Suppose that n=8 and the binary representation is 1 000 0000B.
Sign bit is 1 negative
Absolute value is 000 0000B = 0D
Hence, the integer is -0D
Unit-1
Again, the most significant bit (msb) is the sign bit, with value of 0 representing positive integers and
1 representing negative integers.
The remaining n-1 bits represents the magnitude of the integer, as follows:
o For positive integers, the absolute value of the integer is equal to "the magnitude of the (n-1)bit binary pattern".
o For negative integers, the absolute value of the integer is equal to "the magnitude of the
complement (inverse) of the (n-1)-bit binary pattern" (hence called 1's complement).
The largest and smallest signed integer that can be represented by using Signed Magnitude method of
N bits is
2(N 1) 1 to 2(N 1) 1
Unit-1
Example 1: Suppose that n=8 and the binary representation 0 100 0001B.
Sign bit is 0 positive
Absolute value is 100 0001B = 65D
Hence, the integer is +65D
Example 2: Suppose that n=8 and the binary representation 1 000 0001B.
Sign bit is 1 negative
Absolute value is the complement of 000 0001B, i.e., 111 1110B = 126D
Hence, the integer is -126D
Example 3: Suppose that n=8 and the binary representation 0 000 0000B.
Sign bit is 0 positive
Absolute value is 000 0000B = 0D
Hence, the integer is +0D
Example 4: Suppose that n=8 and the binary representation 1 111 1111B.
Sign bit is 1 negative
Absolute value is the complement of 111 1111B, i.e., 000 0000B = 0D
Hence, the integer is -0D
Unit-1
Again, the most significant bit (msb) is the sign bit, with value of 0 representing positive integers and
1 representing negative integers.
The remaining n-1 bits represents the magnitude of the integer, as follows:
o For positive integers, the absolute value of the integer is equal to "the magnitude of the (n-1)bit binary pattern".
o For negative integers, the absolute value of the integer is equal to "the magnitude of the
complement of the (n-1)-bit binary pattern plus one" (hence called 2's complement).
Unit-1
EXAMPLES:
Example 1: Addition of Two Positive Integers: Suppose that n=8, 65D + 5D = 70D
65D
5D
0100 0001B
0000 0101B (+
-------------0100 0110B 70D (OK)
Example 2: Subtraction is treated as Addition of a Positive and a Negative Integers: Suppose that n=8, 5D
- 5D = 65D + (-5D) = 60D
Unit-1
1011 1111B
1111 1011B (+
-------------1011 1010B -70D (discard carry - OK)
Because of the fixed precision (i.e., fixed number of bits), an n-bit 2's complement signed integer has a
certain range. For example, for n=8, the range of 2's complement signed integers is -128 to +127. During
addition (and subtraction), it is important to check whether the result exceeds this range, in other words,
whether overflow or underflow has occurred.
Example 4: Overflow: Suppose that n=8, 127D + 2D = 129D (overflow - beyond the range)
127D
2D
0111 1111B
0000 0010B (+
------------1000 0001B -127D (wrong)
Example 5: Underflow: Suppose that n=8, -125D - 5D = -130D (underflow - below the range)
-125D
-5D
1000 0011B
1111 1011B (+
--------------0111 1110B +126D (wrong)
The following diagram explains how the 2's complement works. By re-arranging the number line, values
from -128 to +127 are represented contiguously by ignoring the carry bit.
Binary Arithmetic
Rules of Binary Addition
0
0
1
1
+
+
+
+
0
1
0
1
=
=
=
=
0
1
1
0,
For example,
00011010 + 00001100 = 00100110
0
+ 0
0
0
1
0
0
1
1
0
1
1
0
1
1
0
0
0
carries
= 26(base 10)
= 12(base 10)
= 38(base 10)
Unit-1
1
0
0
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
0
carries
= 19(base 10)
= 62(base 10)
= 81(base 10)
Note: The rules of binary addition (without carries) are the same as the truths of the XOR gate.
0
0
1
1
0
1
0
1
=
=
=
=
0
1,
1
0
For example,
00100101 - 00010001 = 00010100
0
- 0
0
0
0
1 10
0 1
0
0
1
0
0
0
1
1
borrows
= 37(base 10)
= 17(base 10)
0 1
= 20(base 10)
0
- 0
0
0
0 10
1 1
0 1
1
0 10
0 1
1
1
1
0
borrows
= 51(base 10)
= 22(base 10)
0 1
1 1
= 29(base 10)
0
0
0
0
1
0
0
0
1
0
0
1
0
1
1
0
0
0
1
0
1
0
0
0
1
0
1
0
0
0
0
0
0
1
0
1
0
0
1
1
x
x
x
x
0
1
0
1
=
=
=
=
0
0
0
1,
For example,
00101001 00000110 = 11110110
0
0
=
=
41(base 10)
6(base 10)
Unit-1
0
246(base 10)
0
0
0
0
0
0
1
0
0
0
1
0
1
1
1
1
=
=
23(base 10)
3(base 10)
1
0
0
1
0
1
1
1
0
1
0
1
1
1
1
1
1
0
0
carries
69(base 10)
Note: The rules of binary multiplication are the same as the truths of the AND gate.
Another Method: Binary multiplication is the same as repeated binary addition; add the multicand to itself
the multiplier number of times.
For example,
00001000 00000011 = 00011000
0
0
+ 0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
=
=
=
carries
8(base 10)
8(base 10)
8(base 10)
24(base 10)
Binary Division
Binary division is the repeated process of subtraction, just as in decimal division.
For example,
00101010 00000110 = 00000111
1
7(base 10)
=
=
42(base 10)
6(base 10)
1
1
0
1
0
1
1
0
1
1
1
1
borrows
0
0
0
27(base 10)
Unit-1
1
1
1
1
0
=
=
135(base 10)
5(base 10)
0
1
1
1
0
1
1
1
0
1
1
1
1
0
0
1
1
0
Notes
Binary Number System
System Digits: 0 and 1
Bit (short for binary digit): A single binary digit
LSB (least significant bit): The rightmost bit
MSB (most significant bit): The leftmost bit
Upper Byte (or nybble): The right-hand byte (or nybble) of a pair
Lower Byte (or nybble): The left-hand byte (or nybble) of a pair
Binary Equivalents
1 Nibble (or nibble) = 4 bits
1 Byte = 2 nibbles = 8 bits
1 Kilobyte (KB) = 1024 bytes
1 Megabyte (MB) = 1024 kilobytes = 1,048,576 bytes
1 Gigabyte (GB ) =1024 megabytes = 1,073,741,824 bytes
Logical Operations on Bits
There are four main logical operations we'll need to perform on hexadecimal and binary numbers: AND, OR,
XOR (exclusive-or), and NOT.
The logical AND operation is a dyadic operation (meaning it accepts exactly two operands). These operands
are single binary (base 2) bits. The AND operation is:
0 and 0 = 0
0 and 1 = 0
1 and 0 = 0
1 and 1 = 1
A compact way to represent the logical AND operation is with a truth table. A truth table takes the following
form:
Unit-1
0 0
0 1
The logical AND operation is, "If the first operand is one and the second operand is one, the result is one;
otherwise the result is zero."
The logical OR operation is also a dyadic operation. Its definition is:
0 or 0 = 0
0 or 1 = 1
1 or 0 = 1
1 or 1 = 1
The truth table for the OR operation takes the following form:
OR Truth Table
OR
0 1
0
Colloquially, the logical OR operation is, "If the first operand or the second operand (or both) is one, the
result is one; otherwise the result is zero." This is also known as the inclusive-OR operation.
The logical XOR (exclusive-or) operation is also a dyadic operation. It is defined as follows:
0 xor 0 = 0
0 xor 1 = 1
1 xor 0 = 1
1 xor 1 = 0
The truth table for the XOR operation takes the following form:
XOR Truth Table
XOR
0 1
0
0 1
1 0
In English, the logical XOR operation is, "If the first operand or the second operand, but not both, is one, the
result is one; otherwise the result is zero." Note that the exclusive-or operation is closer to the English
meaning of the word "or" than is the logical OR operation.
If the first operand contains a zero, then the result is exactly the value of the second operand. This feature
lets you selectively invert bits in a bit string.
The logical NOT operation is a monadic operation (meaning it accepts only one operand). It is:
Unit-1
NOT 0 = 1
NOT 1 = 0
The truth table for the NOT operation takes the following form:
NOT Truth Table
NOT
0 1
1 0
Unit-1
Examples:
Architecture specific binary delivered on Switches, Patch Panels and/or Tape.
2. Second-generation programming language (2GL) Assembly
These were developed in the early 1950s with the ability to use acronyms to speed programming and coding
of programs. They were known generational languages were called assembly languages. They had the
capability to performs operation such like add, sum. Like machine languages, assembly languages were
designed for specific machine and microprocessor, this implies that the program cannot be move from one
computer architecture without writing the code which means learning another language where you are to
transfer the programs.
Examples:
Almost every CPU architecture has a companion assembly language. Most commonly in use today are
RISC, CISC and x86 as that is what our embedded systems and desktop computers use.
3. Third-generation programming language (3GL) Modern
Third generation languages are the primary languages used in general purpose programming today (high
level computer languages popularly known as 3rd generation language (3GLS)). They each vary quite widely
in terms of their particular abstractions and syntax. However, they all share great enhancements in logical
structure over assembly language.
Unit-1
COBOL came into use in the early 1960. It was designed with business administration in mind for
processing large data types with alphanumeric characters which were mixture of alphabet and data and does
repetitive tasks like payroll. The other language was BASIC. These were the early computer programming
languages in the early history of computers, since then there has been improvement and this will be discuss
later.