CPE111 Lec4
CPE111 Lec4
CPE 111
COMPUTER ENGINEERING AS A DISCIPLINE
USTP-CDO | BS-CPE | 2
The above expressions can be written in general forms as the weight of the nth digit of the number
from the right-hand side.
Number Systems
= 𝑛𝑡ℎ 𝑑𝑖𝑔𝑖𝑡 𝑥 10𝑛−1
Number systems are the technique to represent numbers in the computer system architecture, = 𝑛𝑡ℎ 𝑑𝑖𝑔𝑖𝑡 𝑥 (𝑏𝑎𝑠𝑒)𝑛−1
every value that you are saving or getting into/from computer memory has a defined number
system.
The number system in which the weight of each digit depends on its relative position within the
It can have different base values like: binary (base-2), octal (base-8), decimal (base 10) and
number is called the positional number system. The above form of general expression is true
hexadecimal (base 16), here the base number represents the number of digits used in that
only for the positional number system.
numbering system. As an example, in the decimal numbering system, the digits used are: 0, 1, 2,
3, 4, 5, 6, 7, 8 and 9.
Therefore, the digits for binary are: 0 and 1, the digits for octal are: 0, 1, 2, 3, 4, 5, 6 and 7. For
the hexadecimal numbering system, base 16, the digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D,
E, F.
The decimal number system has ten digits represented by 0,1,2,3,4,5,6,7,8,9. So, the base or
radix of such a system in 10.
In this system, the successive position to the left of the decimal point represents units, tens,
hundreds, thousands etc. For example, if we consider a decimal number 257, then the digit
representations are
2 5 7
Position Hundred Tens Units
The weight of each digit of a number depends on its relative position within the number.
Only two digits 0 and 1 are used to represent a binary number system. So the base or radix of Table 4.1: Binary equivalent of decimal numbers
binary system is two (2). The digits 0 and 1 are called bits (Binary Digits). In this number system
the value of the digit will be two times greater than its predecessor. Thus the value of the places Decimal Number Equivalent Binary Number
0 0
is:
64 32 16 8 4 2 1 1 1
2 10
The weight of each binary bit depends on its relative position within the number. It is explained by
the following example: 3 11
4 100
Example 4.2
5 101
The weight of bits of the binary number 10110 is.
6 110
10110 = 1𝑥24 + 0𝑥23 + 1𝑥22 + 1𝑥21 + 0𝑥20
7 111
10110 = 16 + 0 + 4 + 2 + 0
10110 = 22 (𝑑𝑒𝑐𝑖𝑚𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟) 8 1000
9 1001
The weight of each bit of a binary no. depends on its relative pointer within the no. and explained
from right-hand side
𝑊𝑒𝑖𝑔ℎ𝑡 𝑜𝑓 1𝑠𝑡 𝑑𝑖𝑔𝑖𝑡 = 1𝑠𝑡 𝑏𝑖𝑡 𝑥 20
The weight of the nth bit of the number from the right-hand side
It is seen that this rule for a binary number is the same as that for a decimal number system. The
above rule holds good for any other positioned number system. The weight of a digit in any
positioned number system depends on its relative position within the number and the base of the
number system.
A commonly used positional number system is the Octal Number System. This system has eight The hexadecimal number system is now extensively used in computer industry. Its base (or radix)
(8) digit representations as 0,1,2,3,4,5,6 and 7. The base or radix of this system is 8. The values is 16, for example 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. The hexadecimal numbers are used
increase from left to right as 1, 8, 64, 512, 4096 etc. The decimal value 8 is represented in octal to represent binary numbers because of case of conversion and compactness. As 16 = 24 ,
as 10, 9 as 11, 10 as 12 and so on. As 8 = 23 , an octal number is represented by a group of three hexadecimal number is represented by a group of four binary bits. For example, 5 is represented
binary bits. For example, 3 is represented as 011, 4 as 100 etc. Table 4.2 shows the octal number by 0101. Table 4.3 shows the binary equivalent of a decimal number and its hexadecimal
and their binary representations. representation.
Table 4.2: The octal number and their binary representations. Table 4.3: Hexadecimal number and their binary representations.
Decimal Number Octal Number Binary Code Octal Number Decimal Number Hexadecimal Number Binary Code Hexadecimal Number
0 0 000 0 0 0000
1 1 001 1 1 0001
2 2 010 2 2 0010
3 3 011 3 3 0011
4 4 100 4 4 0100
5 5 101 5 5 0101
6 6 110 6 6 0110
7 7 111 7 7 0111
12 C 1100
13 D 1101
14 E 1110
15 F 1111
As the computer uses different number systems, there is a process of converting generally used An easy way to convert from binary to octal is to group binary digits into sets of three, starting with
decimal number systems to other number systems and vice-versa. the least significant (rightmost) digits.
First we mark the bit position and then we give the weight of each bit of the number depending
(11100101)2 = (345)8
on its position. The sum of the weight of all bits gives the equivalent number.
(110100)2 = 32 + 16 + 0 + 4 + 0 + 0
Example 4.6
(110100)2 = (52)10
Convert binary (11100101)2 to its hexadecimal equivalent.
Solution 4.6
Solution 4.4
(11100101)2 = (𝐸5)16
(111011.101)2 = (1𝑥25 + 1𝑥24 + 1𝑥23 + 0𝑥22 + 1𝑥21 + 1𝑥20 ) + (1𝑥2−1 + 0𝑥2−2 + 1𝑥2−3 )
Example 4.7
When the division is complete, connect the remainder of the division. Starting from the bottom
(12.75)10 = (1100.11)2
(MSB) of the table we get 30071.
(12345)10 = (30071)8
Because the conversion results in repeating decimals. The number of decimal places is limited to Find the hexadecimal equivalent of (1234.675)10 .
15 places.
Solution 4.12
The calculation can be terminated after a few steps if the fractional part does not become zero.
Number divides 16 Quotient Remainder
Read from the least significant bit (LSB). 1234/16 77 2
77/16 4 13 (D)
4/16 0 4
(0.123)10 = (0.076763554426416)8
When the division is complete, connect the remainder of the division. Starting from the bottom
(MSB) of the table we get 4D2.
Example 4.14
The method of converting hexadecimal numbers to decimal number is simple. The decimal When converting from hexadecimal to octal, it is often easier to first convert the hexadecimal
equivalent of a hexadecimal number is the sum of the numbers multiplied by their corresponding number into binary and then from binary into octal.
weights.
Example 4.20
Example 4.18
Find the octal equivalent of (𝐴2𝐷𝐸)16 .
Find the decimal equivalent of (4𝐴83)16 .
Solution 4.20
Solution 4.18
Hexadecimal A 2 D E
(4𝐴83)16 = (4𝑥163 + 𝐴𝑥162 + 8𝑥161 + 3𝑥160 ) Binary 1010 0010 1101 1110
1’s Complements
Binary Addition
The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's. This is called It is a key for binary subtraction, multiplication, division. There are four rules of binary addition.
as taking complement or 1's complement. Example of 1's Complement is as follows.
Case A B Sum Carry
1 0 0 0 0
2 0 1 1 0
3 1 0 1 0
4 1 1 0 1
Example 4.21
Add 0011010 + 001100
Solution 4.21
Carry 1 1
0 0 1 1 0 1 0 2610
0 0 1 1 0 0 1210
Sum 0 1 0 0 1 1 0 3810
2’s Complements
The 2's complement of binary number is obtained by adding 1 to the Least Significant Bit (LSB)
of 1's complement of the number. Rules of Binary Addition
2's complement = 1's complement + 1
Example of 2's Complement is as follows. A B A+B Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Example 4.22
00010011 + 00111110
Solution 4.22
Carry 1 1 1 1 1
0 0 0 1 0 0 1 1 1910
0 0 1 1 1 1 1 0 6210
Sum 0 1 0 1 0 0 0 1 8110
A B AxB Subtraction of binary numbers can be accomplished by the direct method by using the 1’s
0 0 0
complement method, which allows to perform subtraction using only addition. for subtraction of
0 1 0
two numbers we have two cases.
1 0 0
1 1 1 1. Subtraction of smaller number from larger number and
2. Subtraction of larger number from smaller number.
Example 4.23
00101001 x 00000110 1’s complement Subtraction of smaller number from larger number
Solution 4.23
Method:
0 0 1 0 1 0 0 1 4110
1. Determine the 1’s complement of the smaller number.
0 0 0 0 0 1 1 0 610
2. Add the 1’s complement to the larger number.
Carry
3. Remove the carry and add it to the result.
0 0 0 0 0 0 0 0
Product 0 0 1 0 1 0 0 1 This is called end -around carry.
0 0 1 0 1 0 0 1
Sum 0 0 1 1 1 1 0 1 1 0 24610
Example 4.25
Express the following numbers in sign magnitude 1’s and 2’s complement: 1 0 1 0 1 1 4310
1 1 1 0 0 1 5710
a. -56 Method 1
b. 107 0 1 0 1 0 0 1’s
Solution 4.24 complement
Method 2
a. -56 Carry 1 1
56 0 1 1 1 0 0 0 1 1 1 0 0 1 5710
-56 1 0 0 0 1 1 1 1’s complement 0 1 0 1 0 0 1’s
complement
Carry 1 1 1 Sum 1 0 1 1 0 1
1 0 0 0 1 1 1 Method 3
Add 1 Carry 1
1 0 0 1 0 0 0 2’s complement Sum 1 0 1 1 0 1
b. 107 1
56 0 1 1 1 0 0 0 Final 0 0 1 1 1 0
-56 1 0 0 0 1 1 1 1’s complement sum
Carry 1 1 1
1 0 0 0 1 1 1
Add 1
1 0 0 1 0 0 0 2’s complement
1’s complement Subtraction of larger number from smaller number 2’s Complement Subtraction
Method: Like 1’s complement subtraction, in 2’s complement subtraction, the subtraction is accomplished
by only addition.
1. Determine the 1’s complement of the larger number.
2. Add the 1’s complement to the smaller number.
3. Answer is in 1’s complement form. To get the answer in true form take the 1’s complement
and assign negative sign to the answer. 2’s complement Subtraction of smaller number from larger
number
1 0 1 0 1 1 4310
1 1 1 0 0 1 5710
Example 4.27
Method 1
0 0 0 1 1 0 1’s Subtract (101011)2 from (111001)2 using 2’s complement method.
complement
Method 2 Solution 4.27
Carry 1 1 1
1 0 1 0 1 1 4310
1 0 1 0 1 1 4310
0 0 0 1 1 0 1’s 1 1 1 0 0 1 5710
complement Method 1
Sum 1 1 0 0 0 1 0 1 0 1 0 0 1’s
Method 3 complement
Sum 1 1 0 0 0 1 Add 1
1’s 1 0 1 1 1 0 Sum 0 1 0 1 0 1 2’s
complement Sign complement
Method 2
Carry 1 1 1
Discard
1 1 1 0 0 1 5710
Advantages of 1’s complement subtraction: 0 1 0 1 0 1 2’s
complement
Sum 0 0 1 1 1 0
1. The 1’s complement subtraction can be accomplished with a binary adder. Therefore,
this method is useful in arithmetic logic circuits.
2. The 1’s complement of a number is easily obtained by inverting each bit in the number.
Method:
1. Determine the 2’s complement of the larger number.
2. Add the 2’s complement to the smaller number.
3. Answer is in 2’s complement form. To get the answer in true form take the 2’s complement
and assign negative sign to the answer.
Example 4.28
Subtract (111001)2 from (101011)2 using 1’s complement method.
Solution 4.28
1 0 1 0 1 1 4310
1 1 1 0 0 1 5710
Method 1
0 0 0 1 1 0 1’s
complement
Add 1
Sum 0 0 0 1 1 1 2’s
complement
Method 2
Carry 1 1 1 1
1 0 1 0 1 1 4310
0 0 0 1 1 1 2’s
complement
Sum 1 1 0 0 1 0
Method 3
Carry
1’s 0 0 1 1 0 1
complement
of the Sum A computer is an electromechanical device that processes or manipulates data. Computer
Add 1 consists of hardware, the physical parts of the computer and software, the programs or sets of
Sum - 0 0 1 1 1 0 2’s instructions that tell the computer what to do. During the computing process, computers integrate
complement the use of the five key elements:
Hardware – computer's hardware consists of electronic devices; the parts you can see
and touch.
Software - consists of organized sets of instructions for controlling the computer.
Data - a representation of facts, and concepts.
Users/People – people are the operators, also known as users.
Procedures – steps to follow for processing data.
Processing
Systems
The processor is like the brain of the computer; it organizes and carries out instructions that
come from either the user or the software.
A processor is usually a single chip or a set of chips contained on a circuit board knows as main
board or mother board. The term central processing unit (CPU) refers to a computer’s processor.
Input Devices
Systems
Keyboards
Mouse
Pens
Touch Screens
Game Controllers
Bar Code Readers
Scanners
Optical Character Reader (OCR) The two main parts of a CPU are the control unit and the arithmetic logic unit (ALU). The control
Microphones unit directs the flow of data through the CPU, and to and from other devices. It stores the CPU's
Digital Cameras microcode, which contains the instructions for all the tasks the CPU can perform. The actual
manipulation of data takes place in the ALU. The ALU can perform arithmetic and logic
operations. The ALU is connected to a set of registers—small memory areas in the CPU, which
hold data and program instructions while they are being processed.
This is the part that holds all of the internal components to make up the computer itself.
It is usually designed in such a manner to make fitting a motherboard, wiring, and drives
as easy as possible.
Storage Devices Some are designed so well that it is easy to make everything look tidy and presentable
Systems too.
Cases come in all different shapes and sizes to accommodate various types of computer
Magnetic drive components and satisfy the consumer’s needs.
Optical dives (CD ROM, DVD) Design elements can vary from being plain to extremely elaborate. You can get a plain
grey case or one that has colored lighting everywhere to make it looks spectacular.
Cases, like most things, vary in quality. You can get them made from cheap metals or
good quality materials that provide you with a sturdy design.
USTP-CDO | BS-CPE | 29 USTP-CDO | BS-CPE | 30
List of computer case sizes (known as form factor): Central Processing Unit (CPU)
Very small form factor: Supports Mini ITX motherboards Systems
Small form factor: Supports micro ATX motherboards.
Standard form factor: Supports standard ATX motherboards.
Larger form factors: Supports ATX and XL-ATX motherboards.
Mother Board
Systems
The CPU is basically like the brain of a computer. It processes all the information on a
computational level.
It takes information from the RAM and processes it to perform the tasks required from the
computer.
It is usually seated in a socket that utilizes a lever or a latch with a hinged plate with a cut
out in the center to secure it onto the motherboard.
It has many copper pads underneath it for the socket contacts to push up against them to
make electrical contact.
There are other ways CPUs can be attached to the motherboard.
The motherboard is the main board that is screwed directly inside the computer case. All Here are some common examples:
other cards and everything else plugs directly into the motherboard, hence its name.
The CPU, RAM, drives, power supply, and more all get connected to it. ZIF (Zero Insertion Force): Although this a more desirable socket, they are mostly found
Its function is to integrate all the components so they can communicate and operate on older computer motherboards. A lever-operated mechanism to clamp the pins of the
together. processor.
A good motherboard offers a wide amount of connectivity options. It also has the least PGA (Pin Grid Array): It is also a ZIF socket but has a different pin pitch and contains a
amount of bottlenecks possible. This allows all the components to operate efficiently and different pin count.
to fulfill their maximum potential as they were designed to do. LGA (Land Grid Array): More commonly found on motherboards today. A levered hinged
Obviously, as the physical size is reduced, it begins to limit connectivity options and plate with a center cut-out clamps down on the processor.
functionality. BGA (Ball Grid Array): The CPU is soldered directly onto the motherboard. This makes
it a non-user swappable part. It is susceptible to bad connectivity.
Mother boards come in the following sizes:
Motherboard Dimensions
Pico-ITX 3.9 inch x 2.9 inch | 100mm x 72mm A processor generates a decent amount of heat, especially when it is working under high loads.
Nano-ITX 4.7 inch x 4.7 inch | 120mm x 120mm It will run even hotter when it is set to a higher clock speed to make it run faster. This is called
Mini-ITX 6.7 inch x 6.7 inch | 170mm x 170mm overclocking.
Micro-ATX 9.6 inch x 9.6 inch | 244mm x 244mm This is why a heatsink and fan assembly are required to draw the heat away from the processor
Standard-ATX 12 inch x 9.6 inch | 305mm x 244mm and distribute it to thin sheets or fins of metal for the fan to cool down.
XL-ATX EVGA: 13.5 inch x 10.3 inch | 343mm x 262mm There are so many different types of processors. The top manufacturers of computers are Intel,
Gigabyte: 13.58 inch x 10.31 inch | 345mm x 262mm AMD, and NVidia.
Micro-Star: 13.6 inch x 10.4 inch | 345mm x 264mm
Systems Systems
RAM is a data storage device that can provide fast read and write access. RAM is also
volatile, which means that it loses all the stored data when power is lost. A graphics card processes the data from the motherboard and sends the appropriate
The RAM keeps data ready for the CPU to process. The speed of the RAM is a big information to the monitor for it to be displayed.
contributor to the overall speed of a computer. It can do so using an HDMI, DisplayPort, DVI, or VGA connector.
It plugs directly into a long slot that has contacts on either side of the slot. A graphics card can also be referred to as a video card or a display card.
It, too, has a clock speed, just like a processor. So, it can also be overclocked to deliver It takes the burden of all the video processing from the main CPU. This gives a computer
increased performance beyond the intended specification. a big boost in performance.
Certain RAM modules are sold with a heat spreader. It helps dissipate the heat from the Because of the large processing requirements for a gaming graphics card, fans are almost
individual memory IC’s, keeping them cooler. a given.
RAM has evolved like any other component. RAM used on the motherboard often uses A graphics card plugs into a PCI Express (Peripheral Component Interconnect Express)
DDR (Double Data Rate) SDRAM (Synchronous Dynamic Random Access Memory) type slot on the motherboard. It is a serial expansion bus slot capable of a high amount of
memory. bandwidth in two directions.
A graphics card has a GPU (Graphics Processing Unit) which is the main component that
requires cooling.
A GPU is slower than a CPU, but it is designed to deal with mathematical operations
required for video rendering.
The amount of memory on the card varies depending on the manufacturer’s design.
Graphics cards use GDDR (Graphics Double Data Rate) SDRAM, which is specially
designed to optimize graphics performance.
GDDR is built to handle a higher bandwidth compared to plain DDR RAM.
Systems Systems
A hard drive is found in most computers. It’s usually a mechanical drive that stores all the
data.
Apart from storing data, it can also be used as a boot drive to run the operating system
Most of the time, the sound chips built into the motherboard is used for audio output.
from it.
But, if you are a sound enthusiast or prefer higher detailed audio while playing a game,
An operating system is a software program that makes a computer useable like Microsoft
you might be inclined to use a sound card.
Windows, for example. The biggest vulnerability of a mechanical drive is its physically
Sound cards plug into a computer in multiple ways. It can be through USB, PCI slot, or
fragile nature.
PCI Express x 1 slot.
One bump the wrong way can destroy a whole drive. A mechanical hard drive contains
External DACs (Digital-to-Analog Converter) have gained a lot more popularity and help
one or more platters that spin anywhere between 5200 to 10000 RPM (revolutions per
deliver clearer and more defined audio.
minute).
They connect up using an IO cable like a USB cable to your computer or laptop and
The read and write heads are spaced only about 0.002 (51 micro M) inches away from
provide a line out for your speakers or headphones.
the platter.
A sound processing chip on the card does all of the audio processing and is usually not a
This gives you an idea about the physical limitations regarding its fragile nature.
very powerful processor.
Small areas on the platter can be arranged to represent a 1 or a 0. It can be changed
A sound card can offer a wide range of connectivity with various audio equipment.
using the drive head to alter the material to represent the correct value magnetically.
A few examples could be optical audio, 1/4-inch jack, or RCA connectors.
There are various categories of hard drives made for various real-world applications.
Systems Systems
A power supply mounts inside the computer case. This converts the AC mains supply
from the wall socket and supplies the correct DC voltages to all the components inside
the computer.
A computer power supply supplies the following voltages:
o +3.3v: This voltage is supplied to the motherboard.
An SSD is also a type of hard drive, but it does not have any moving parts. It consists of o +5V: This voltage is supplied to the motherboard and other internal components.
a bank of flash memory that can hold a reasonable amount of data. o +12V: This voltage is supplied to the motherboard and other internal
While SSD’s are increasing in size all the time, they aren’t cost-effective for storing large components.
amounts of data. o -12V: This voltage is supplied to the motherboard.
A mechanical drive has a cheaper gigabyte to dollar ratio. You get different wattage ratings for power supplies. The higher the wattage, the higher
However, the SSD is a high-performance drive. It’s fast and cannot be as easily damaged the electrical current that can be made available to parts that need it.
by dropping it or taking a few knocks. The higher you go in Watts, the more the power supply will be likely to cost.
SSDs are available as 2.5-inch laptop encapsulated drives as well as an M.2 SDD as the A power supply also comes with its own cooling fan. This helps all the internal
most commonly used kinds on the market. components to stay cool when the power supply is subjected to bigger loads.
That is why I always recommend SSD’s for portable-type computers where possible. You If you would like to know more about a power supply and its lifespan, I have written an
can read more about whether or not SSD’s are worth it in our other article. article discussing it more in-depth.
Systems Systems
A keyboard is one of the ways to communicate with a computer. Typing a key from the
keyboard sends a small portion of data to tell the computer which key was pressed.
The computer can use this information in many ways. An example could be a command
or a character that can be used in a document.
There are two main different types of keyboards. Mechanical and membrane types.
A monitor is what you use to visualize the graphics data sent from the computer’s graphics
card. Mouse
There are various types of monitors on the market. The most commonly used is a LED- Systems
backlit LCD monitor.
There are also a variety of different sizes with different aspect ratios. The aspect ratio is
simply the ratio between height and width.
For example, a 16:9 aspect ratio monitor will have 16 parts wide to 9 parts in height.
There are also curved monitors, but they are more expensive.
Monitors also have a fast response time to keep up with the high demands required to
eliminate delays with user input for gaming.
A mouse allows the user to move a pointer displayed on the monitor and experience a
more intuitive interaction with the computer.
These days’ mice have more buttons than the common three.
However, the three main buttons allow the user to select, grab, scroll and access extra
menus and options.
A computer mouse can be wired or wireless. The latter obviously requires batteries.
Optical mice of today allow for very accurate precision and smooth movement.
Systems Systems
Here are some common peripherals that get connected to a computer and that extend their
usefulness.
Printer
Systems
A scanner can take anything on paper and scan it to produce a replicated digital image.
This is also very handy for saving physical photos that you want to preserve.
Once the photo is stored digitally, it won’t decay as a physical photo does over time.
The flatbed scanner is the most commonly used today.
There are many all-in-one devices also known as multifunction devices which have printer
and scanning capabilities in one reasonably compact product.
Computer Speakers
Systems
A printer can take an image sent by a computer and deliver it onto a sheet of paper.
It does this by using the data from the computer, and by either using toner or ink, it deposits
one of these in a controlled and accurate manner to form the image.
Computer speakers can connect up to the sound card at the rear of the computer.
Another way they can be connected is by a monitor that already has built-in speakers.
Generally, the sound quality is poor from a monitor’s speakers. That’s why most people
buy a set of computer speakers to have on their computer desk.
You can even connect up a 7.1 surround speaker system to certain sound cards.
This can add a nicer experience to gaming, playing music, or watching a film.
References
Activity 4.2: Paint Me A Picture
Fundamental of Computers. (n.d.). Lecture.
Okay! After you know the computer system, you will now make a one (1) page CREATIVE Introduction to Informatics Uttarakhand Open University
INFOGRAPHIC. Submit it in our google classroom. Number Systems,Compliments And Codes. (n.d.). Lecture.
Number Systems. (n.d.).
Palit, R. (n.d.). Introduction to Number and Computer Systems. Lecture.
Parts of a computer and their functions (with pictures). Parts Of A Computer And Their
Systems
Functions (With Pictures). (n.d.). Retrieved October 22, 2022, from
https://computerinfobits.com/parts-of-computer-and-their-functions/