You are on page 1of 10

1ST SEMESTER: MIDTERMS EXAMINATION

ITC – INTRODUCTION TO COMPUTING (COMP 001)


Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

SYLLABUS o Digital – performs calculations and logical operations


with quantities represented as digits, usually in binary
1. Overview of ICT
system.
2. Number System
o Hybrid – Processes both analog and digital data. It
3. Conversion of Number Systems
accepts analog signals, converts, and processes
4. Number Systems Arithmetic
them to digital form.
5. Data Representation
• According to purpose:
OVERVIEW OF ICT o General – utilized for ordinary work. It can do
numerous sorts of work, yet ordinary sets of tasks.
o Special – Built for a particular task. More than one
COMPUTER CPU is required, numerous computers are introduced
● An electronic device that accepts data, processes it, on these computers.
and converts it into useful information.
• According to size:
o Microcomputer – relatively inexpensive; uses
PROCESSING CYCLE OF COMPUTER microprocessor as CPU; formed the foundation of
modern smart gadgets.
Gathering data from external sources o Minicomputer – designed for control,
Input
to computer. instrumentation, human interaction, and
communication switching.
Performing operations from gathered o Mainframe (a.k.a big iron) – used by big
Process data using algorithms, calculations, organizations for bulk data processing.
and other types of processes. o Supercomputers – High level performing system;
used in intensive computation tasks in various fields
Displaying the processes information such as quantum mechanics, weather forecasting,
Output climate research, etc.
in a human-readable form.

Saving data or information for later


Storage used, stored in computer’s memory or
ELEMENTS OF COMPUTER SYSTEM
hard drives.
Raw facts and figures that are collected and
processed by the computer.
Transferring data between computer Data
systems and external drives or other
Data can me text, numbers, images, and more.
Communication computer systems. This involves
networking where data is being sent
and received. Software refers to the intangible component of a
computer system.
Software
CHARACTERISTICS OF COMPUTER SYSTEM Software includes operating systems,
applications, and utility programs.
• Automation, Diligence, Versatility, Accuracy,
Memory, Reliability, Speed (ADVAMRS) These are the humans which are involved in
interacting and developing with the computer.
Peopleware
LIMITATIONS OF COMPUTER SYSTEM (most important)
Peopleware includes users, operators, system
• Can only do what it is designed/programmed to do. analysts, programmers, and engineers.
• Cannot correct input data.
• Cannot think and derive meanings from objects. Processed and organized data. Result of
• Can only process jobs have expressed in a number Information applying software and human intelligence to raw
of steps. data.
• Cannot completely avoid errors due to system
malfunctions or human errors. The exchange of data and information between
computers or external devices.
CLASSIFICATION OF COMPUTERS Communication
Communication occurs through networks,
internet, collaborative activity where data are
• For individual users:
shared and transferred.
o Desktop, workstation, notebook, tablet, handheld,
smartphones
Hardware refers to the tangible component of a
computer system. The hardware is the
• For organizations:
machinery itself.
o Servers, mainframes, supercomputers
Hardware Hardware includes central processing unit
(CPU), memory (RAM), storage devices (hard
• According to type of processing: drives, SSDs), input devices (keyboard,
o Analog – uses the continuously-changeable aspects of mouse), output devices (monitor, printer), etc.
physical fact (electrical, mechanical, hydraulic quantities)
to model the problem being solved.
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

APPLICATIONS OF COMPUTER 1896


● Punch Card Machine
• Medicine, Machinery, Architecture, Politics, (America) – this device
Architecture, Education, Science & Technology, was invented by Herman
Entertainment, Officeworks, E-commerce. Hollerith.
● It automatically read the
HISTORY OF COMPUTING information that had
been punched into the
I. Earliest Computing Devices card, without human
intermediation.
2nd Century
● Abacus (China) – A frame with beads strung on 1897
wires and rods and arithmetic calculations are ● Automatic Calculating Machine (America) – this
formed by manipulating the beads. device was invented by Howard Aiken.
17th Century ● It handled 23 decimal place numbers and could
perform all four arithmetic operations. It has built-in
● Napier’s Logs and Bones special programs, or subroutines, to handle
(Europe) – this device was logarithms and trigonometric functions.
invented by John Napier; it
is a simple device for
multiplying.

● Oughtred’s Slide Rule (Europe) – this device was


invented by William Oughtred.
● Consists of two movable rulers placed side by side.
Each ruler is marked off in such a way that the actual 1930
distance from the beginning of the ruler is ● Differential Analyzer –
proportional to the logarithms of the number printed this device was invented
on the ruler. by Dr. Vannevar Bush.
● It is used to calculate
artillery trajectories
during World War II.

1943
1642 ● Electronic Numeric Integrated and Calculator
● Calculator (France) – this device was invented by (ENIAC) – this device was invented by Presper
Wilhelm Von Leibniz; it can add, subtract, multiply, Eckert Jr. and John Mauchly.
and divide numbers. [Leibniz calculator]. ● It is the first large-scale vacuum tube computer.
● First mainframe computer.

1946
● Electronic Discrete Variable Automatic
Computer (EDVAC) – this device was invented by
John Von Neumann
● Modified version of ENIAC.
1833 (19th Century)
● Analytical Engine/ II. Generations of Computers
Difference Engine
(America) – this First Generation (1946-1959)
device was invented by ● The use of vacuum tubes as a means of storing fata in
Charles Babbage. memory and the use of the store program concept.
● Calculates and prints Advantages:
mathematical tables. 1. Made use of vacuum tubes which are the only
● First steam-powered electronic component available.
computer (Babbage is 2. These computers could calculate in milliseconds.
the Father of the Disadvantages:
Computer). 1. Very big in size (about 30 tons); costly; less work
efficiency; and based only on vacuum tubes (requires
large cooling system).
2. Limited programming capabilities.
3. Large energy consumption.
4. Unreliable and needs constant maintenance.
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

Second Generation (1959-1965) Advantages:


1. More reliable and works faster.
● The use of transistors, diodes, and magnetic storage,
2. Available in different sizes and unique features.
built-in error detecting devices.
3. Provides computers with more user-friendly interfaces
Advantages:
with multimedia features.
1. Transistors replaced vacuum tubes; the size of
electron component is decreased (reduced sizes of
computers). NUMBER SYSTEM
2. Less energy used; faster (microseconds); better
portability; low cost. NUMBER SYSTEM
3. Assembly language and punch cards for input.
Disadvantages: ● A style/system of notations that represent numbers.
1. Cooling system and maintenance was required. ● These systems are classified according to the values
2. Only used for specific purposes. of the base of the number system. There are 4
systems: Decimal, Binary, Octal, Hexadecimal.
Third Generation (1965-1971) ● Bases are also called radix.
● The use of integrated solid-state circuity improved ● The systems are identified through their
secondary storage devices, and new input/output subscripts (bases): [2], [8], [10], [16].
devices were the most important advantages.
● Integrated Circuit (IC) – Single component containing DECIMAL NUMBER SYSTEM
transistors. Invented by Robert Noyce and Jack Kilby
In 1958-1959. ● Consists of ten (10) different digits—
Advantages: o 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
1. Cheaper than second-gen computers. ● Has a base of ten (10).
2. Faster (computation time: nanoseconds) and reliable.
● Example: 6910
3. The use of IC reduces the size of the computer, better
performance, and bigger storage capacity.
4. Mouse and keypad are used for input.
5. Used an operating system (OS) for better resource BINARY NUMBER SYSTEM
management, time-sharing, and multiple
programming. ● Has only two (2) different digits— 0 and 1.
Disadvantages: ● Has a base of two (2).
1. IC chips are difficult to maintain. ● 0 and 1 is described as on-and off switch:
2. Highly sophisticated technology required in o 0 is false or off switch.
manufacturing IC chips. o 1 is true or on switch.
3. Air conditioning is required (cool room).
● Example: 10001012
Fourth Generation (1971-1980) OCTAL NUMBER SYSTEM
● Emergence of different areas in computer technology:
o Multiprocessing, multiprogramming, miniaturation, ● Consists of eight (8) different digits—
time-sharing, operating speed, and virtual storage. o 0, 1, 2, 3, 4, 5, 6, 7
● This technology is based on Microprocessor. ● Has a base of eight (8).
● Microprocessor – used in a computer for any logical and ● NOTE: any octal number cannot have any digit
arithmetic function to be performed in any program. greater than 7.
● Graphics User Interface (GUI) technology was exploited ● Example: 1058
to offer more comfort to users.
Advantages: HEXADECIMAL NUMBER SYSTEM
1. The size of computer is more reduced and have the
fastest computation time.
2. Heat generated is negligible, less maintenance. ● Consists of sixteen (16) different digits—
3. High-level language can be used in these computers. o 0 to 9, A, B, C, D, E, F
Disadvantages: ● The letters represent the numbers 10 to 15.
1. Microprocessor designing and fabrication are very
complex. [A = 10; B = 11; C = 12; D = 13; E = 14; F = 15]
2. Air conditioning is required in many cases due to the
presence of ICs. ● Has a base of sixteen (16).
3. Advance technology is required to make ICs. ● NOTE: any hexadecimal number cannot have any
digit greater than F (15).
Fifth Generation (1980 - onwards) ● Example: 4516
● Based on artificial intelligence; aims to make the device
respond to natural language input and are capable of
learning and self-organization. Hierarchy in bits:
● Based on Ultra Large-Scale Integration (ULSI) 24 Least significant bit (LSB)
technology, resulting in the production of
microprocessor chips having 10 million electronic Most significant bit (MSB)
components.
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

CONVERSION OF NUMBER SYSTEM 3. Decimal to Hexadecimal


● Use continuous division on getting the hexadecimal
DECIMAL → RADIX (B, O, H)
value.
1. Decimal to Binary ● The divisor must be sixteen (16)
● If the quotient is less than 16, stop dividing.
● Use continuous division on getting the binary value ● The arrangement of the hexadecimal equivalent
(be mindful of the remainders). goes from bottom to top.
● The divisor must be two (2) ● Unlike binary (0 and 1 values only), hexadecimal
● If the quotient is one, stop dividing. equivalent ranges from 1-16.
● The arrangement of the binary equivalent goes from ● The remainders 10-15 must be translated into letters
bottom to top. according to their assigned value (A, B, C, D, E, F).

Ex. 24 to binary Ex. 42069 to Octal


Remainder: Remainder:
2 24 = 0 16 42069 =5

Bottom to top
Bottom to top

2 12 = 0 Binary Form: 16 2629 =5 Hexadecimal Form:


2 6 =0 110002 16 164 =4 A45516
2 3 =1 16 10 =A
1 =1 Stop here.
Stop here.

Alternative solution: Binary series plotting Series plotting is also applicable to this radix, but its not
● Can be useful to short decimals to be solved. advisable because the solution may come as lengthy.
● Must memorize the exponential progression of 2—
o 20 = 1; 21 = 2; 22 = 4; 23 = 8; 24 = 16; 2n = n. RADIX (B, O, H) → DECIMAL
● Pick a number from the progression that is closest to
the given decimal, then subtract the decimal to the 1. Binary to Decimal
progression in a backwards manner.
● Multiply the digits (from right to left) with the
● The arrangement of the binary equivalent goes from exponents of 2 (starting from 20… onwards)
left to right.
Ex. 110002 to Decimal
Ex. 24 to binary
1 1 0 0 0
24 8 0 X X X 0 x 20 = 0 (8 + 16) = 24 = 110002
16 8 4 2 1 0 x 21 = 0
24 23 22 21 20
0 x 22 = 0
Binary Form: 1 1 0 0 0 1 x 23 = 8
110002
1 x 24 = 16

2. Octal to Decimal
2. Decimal to Octal
● Multiply the digits (from right to left) with the
● Use continuous division on getting the octal value. exponents of 8 (starting from 80… onwards)
● The divisor must be eight (8)
● If the quotient is less than 8, stop dividing. Ex. 2568 to Decimal
● The arrangement of the octal equivalent goes from
bottom to top. 2 5 6
● Unlike binary (0 and 1 values only), octal equivalent
6 x 80 = 6 (6 + 40 + 128) = 174 = 2568
ranges from 1-7.
5 x 81 = 40
2 x 82 = 128
Ex. 420 to Octal
Remainder:
3. Hexadecimal to Decimal
Bottom to top

8 420 = 4
● Multiply the digits (from right to left) with the
8 52 =4 Octal Form: exponents of 16 (starting from 160… onwards)
8 6 =6 6448

Stop here. Ex. FAB16 to Decimal

F(15) A(10) B(11)


Series plotting is also applicable to this radix, but its
not advisable because the solution may come as 11 x 160 = 11 (11 + 160 + 3840) = 4011 = FAB16
lengthy. 10 x 161 = 160
15 x 162 = 3840
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

OTHER CONVERSIONS 5. Octal to Hexadecimal


● Two-step process: (1) Octal to Binary; (2) Binary to
1. Binary to Octal Hexadecimal.
● Divide and group the binary number into three, ● Cannot be directly converted with one step;
starting from least significant bit (from right to left). binary acts as a bridge to convert these two systems.
● Align 4, 2, and 1 with the divided groups (equivalent
to 20, 21, 22), and get the sum of the groups (3:1). Ex. 7258 to Hexadecimal
1. Octal to Binary
Ex. 1010111012 to Octal
7 2 5
1 0 1 0 1 1 1 0 1 421
421 421
421
4+1 4+1 111 010 101
2+1
1010111012 = 5358 7258 = 1110101012
2. Binary to Hexadecimal
2. Binary to Hexadecimal
1 1 1 0 1 0 1 0 1
● Divide and group the binary number into four, starting
from least significant bit (from right to left). 8421
● Align 8, 4, 2, and 1 with the divided groups
1 13/D 5
(equivalent to 20, 21, 22, 23), and get the sum of the
groups (4:1).
1110101012 = 1D516
Ex. 0111110000112 to Hexadecimal
6. Hexadecimal to Octal
0 1 1 1 1 1 0 0 0 0 1 1
● Two-step process: (1) Hexadecimal to Binary; (2)
8421 Binary to Octal.
7 12/C 3
● Cannot be directly converted with one step;
0111110000112 = 7C316 binary acts as a bridge to convert these two systems.

3. Octal to Binary Ex. 1D516 to Octal


1. Hexadecimal to Binary
● Reverse method of grouping technique; find the
correct addends (4, 2, 1) for the sum (given octal). 1 13 5
● Use the addends to indicate that its present (“1”) and
(“0”) if not present (1:3). 8421 8421 8421
0001 1101 0101
Ex. 1238 to Binary
1D516 = 0001110101012
1 2 3 2. Binary to Octal
421 421 421
0 0 0 1 1 1 0 1 0 1 0 1
001 010 011 421
1238 = 0010100112 0 4+2+1 2 4+1
0001110101012 = 7258
4. Hexadecimal to Binary
● Reverse method of grouping technique; find the DECIMAL FRACTION → RADIX FRACTION
correct addends (8, 4, 2, 1) for the sum (given hexa.).
● Use the addends to indicate that its present (“1”) and 1. Decimal Fraction to Binary Fraction
(“0”) if not present (1:4). ● The method used is continuous multiplication;
multiplicand used is 2.
Ex. 6BB16 to Binary ● When product is terminating, stop at product with 0
decimal units. (ex. 1.00)
6 11 11
● When product is non-terminating, continue
8421 8421 8421 multiplying until 8th equation (8-bits).
0110 1011 1011
Ex. 0.696 to Binary Fraction
6BB16 = 0110101110112
(0.696 x 2) = 1.392 (0.136 x 2) = 0.272
(0.392 x 2) = 0.784 (0.272 x 2) = 0.544
(0.784 x 2) = 1.568 (0.544 x 2) = 1.088
(0.568 x 2) = 1.136 (0.088 x 2) = 0.176

0.696 = 0.101100102
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

2. Decimal Fraction to Octal Fraction 3. Hexadecimal Fraction to Decimal Fraction


● The method used is continuous multiplication; ● Multiply the digits (from left to right) with the
multiplicand used is 8. exponents of 16 (starting from 16-1… onwards).
● When product is terminating, stop at product with 0
decimal units. (ex. 7.00) Ex. 0.BAC16 to Decimal
● When product is non-terminating, continue
multiplying until 8th equation (8-bits). 11 x 16-1 = 0.6875
10 x 16-2 = 0.0390625
12 x 16-3 = 0.0029296875
Ex. 0.696 to Octal Fraction

(0.696 x 8) = 5.568 (0.816 x 8) = 6.528 0.BAC16 = 0.7294921875


(0.568 x 8) = 4.544 (0.528 x 8) = 4.224
(0.544 x 8) = 4.352 (0.224 x 8) = 1.792 OTHER CONVERSIONS (FRACTIONS)
(0.352 x 8) = 2.816 (0.792 x 8) = 6.336
1. Binary Fraction to Octal Fraction
0.696 = 0.544264168 ● Divide and group the binary number into three,
starting from most significant bit (from left to right).
3. Decimal Fraction to Hexadecimal Fraction ● Align 4, 2, and 1 with the divided groups (equivalent
● The method used is continuous multiplication; to 20, 21, 22), and get the sum of the groups (3:1).
multiplicand used is 16.
● When product is terminating, stop at product with 0 Ex. 11101.010112 to OF
decimal units. (ex. 15.00)
1 1 1 0 1 . 0 1 0 1 1
● When product is non-terminating, continue
multiplying until 8th equation (8-bits). 3 5 2 6
Ex. 0.696 to Hexadecimal Fraction
11101.010112 = 35.26
(0.696 x 16) = 11.136 (0.056 x 16) = 0.896
(0.136 x 16) = 2.176 (0.896 x 16) = 14.336
2. Binary Fraction to Hexadecimal Fraction
(0.176 x 16) = 2.816 (0.336 x 16) = 5.376 ● Divide and group the binary number into three,
(0.816 x 16) = 13.056 (0.376 x 16) = 6.016 starting from most significant bit (from left to right).
● Align 8, 4, 2, and 1 with the divided groups
0.696 = 0.B22D0E5616 (equivalent to 20, 21, 22, 23), and get the sum of the
groups (4:1).
RADIX FRACTION → DECIMAL FRACTION
Ex. 11101.010112 to HF
1. Binary Fraction to Decimal Fraction
● Multiply the digits (from left to right) with the 1 1 1 0 1 . 0 1 0 1 1
exponents of 2 (starting from 2-1… onwards).
1 13/D 5 8
Ex. 101.1112 to Decimal
11101.010112 = 1D.5816
1 1 0 . 1 1 1
3. Octal Fraction to Binary Fraction
0
0x2 =0 -1
1 x 2 = 0.5 ● Reverse method of grouping technique; find the
1 x 21 = 2 1 x 2-2 = 0.25 correct addends (4, 2, 1) for the sum (given octal).
1 x 22 = 4 1 x 2-3 = 0.125 ● Use the addends to indicate that its present (“1”) and
6 0.875 (“0”) if not present (1:3).

101.1112 = 6.875 Ex. 12.1238 to Binary

2. Octal Fraction to Decimal Fraction 1 2 . 1 2 3


● Multiply the digits (from left to right) with the 421 421 421 421
exponents of 8 (starting from 8-1… onwards).
421
001 010 001 010 011
Ex. 0.3128 to Decimal
12.1238 = 1010.0010100112
3x 8-1 = 0.375
1 x 8-2 = 0.015625
2 x 8-3 = 0.00390625 4. Hexadecimal Fraction to Binary Fraction
● Reverse method of grouping technique; find the
0.3128 = 0.39453125 correct addends (8, 4, 2, 1) for the sum (given hexa.).
● Use the addends to indicate that its present (“1”) and
(“0”) if not present (1:4).
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

Ex. 0.A4916 to Binary


NUMBER SYSTEMS ARITHMETIC
0 . 10 4 9 ADDITION
8421 8421 8421
1. Decimal
1010 0100 1001 ● Normal addition of real numbers that we usually do.
0.A498 = 0.1010010010012 ● When you’re about to carry, subtract the sum from
the base (10).
5. Octal Fraction to Hexadecimal Fraction ● When subtracting using the base, add a sub count to
the succeeding digit (carry).
● Two-step process: (1) Octal to Binary; (2) Binary to Ex.
Hexadecimal.
● Cannot be directly converted with one step; 443 553 47.76
binary acts as a bridge to convert these two systems. 98 763 9.99
Ex. 0.6478 to Hexadecimal Fraction
4 13 11 12 11 6 4 16 . 16 15
1. OF to BF 10 10 10 10 10 . 10 10
5 4 1 1 3 1 6 5 7 .7 5
0 . 6 4 7
421 421 421 2. Binary
110 100 111 ● Uses only “0” and “1”, but follows six basic rules:
o 0+0=0
0.6478 = 0.1101001112 o 0+1=1
2. Binary to Hexadecimal o 1+0=1
o 1 + 1 = 10 (carry 1, sum 0)
0 . 1 1 0 1 0 0 1 1 1 o 1 + 1 + 1 = 11 (carry 1, sum 1)
o 1 + 1 + 1 + 1 = 21 (carry 2, sum 1)
8421 Ex.
101112
13/D 3 8 11012 101102 1011.01101
10012 101112 1100.10110
0.1101001112 = 0.D3816
101102 10001002 11000.00011
6. Hexadecimal Fraction to Octal Fraction
3. Octal
● Two-step process: (1) Hexadecimal to Binary; (2)
Binary to Octal. ● When you’re about to carry, subtract the sum from
the base (8).
● Cannot be directly converted with one step;
binary acts as a bridge to convert these two systems. ● When subtracting using the base, add a sub count to
the succeeding digit (carry).
Ex. 0.FAB16 to Octal Fraction
1. Hexadecimal to Binary
4628 7748 54.668
0 . 15 10 11 7328 6578 11.298
8421 11 9 4 13 12 11 6 5 . 8 15
8421 8421
88 8 8 8 .8 8
1111 1010 1011
14 14 5 4 3 6 6 . 1 78
0.FAB16 = 1111101010112
2. Binary to Octal 4. Hexadecimal
● When you’re about to carry, subtract the sum from
1 1 1 1 1 0 1 0 1 0 1 1 the base (16).
421 ● When subtracting using the base, add a sub count to
7 6 5 3 the succeeding digit (carry).
0.1111101010112 = 0.76538
ADC8 BD.DDC
BBC8 F.DAB
21 24 24 13 28 . 26 23 23
16 16 16 16 . 16 16 16
1 6 9 8 C D . B 8 7
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

SUBTRACTION 2’S COMPLEMENT

1. Decimal Steps:
● Normal subtracting; base of 10. 1. To get the 2’s complement of the subtrahend, get its 1’s
complement (reversing) then add “1”.
● When the subtrahend > minuend, borrow 1 from the 2. Add the minuend with the 2’s complement of subtrahend.
next place value (to the left) and add the base (10) to
3. Get the 2’s complement of the sum from Step 2.
the minuend. This adjustment allows for the
4. Check the signs of the value
subtraction of the two place values.
If (subtrahend > minuend) = negative
● If the entire subtrahend > minuend, the difference is If (minuend > subtrahend) = positive
automatically negative, but to subtract the two,
switch the minuend and subtrahend. NOTE: When performing addition, disregard the extra carry
Ex. from adding.
67.49 – 155.55 = ?
512 49.25 Ex. 10110012 – 11100012 = ?
- 477 - 9.99 155.55
11100012 ~ 00011102 11010002 ~ 00101112
35 39.26 - 67.49
-88.06 0001110 1011001 0010111
+ 1 + 0001111 + 1
2. Binary (Direct Method)
0001111 1101000 - 0011000
● Uses only “0” and “1”, but follows 3 basic rules:
o 0-0=0
o 0 - 1 = borrow 2 from left side If minuend > subtrahend, it is conducive to just
o 1-0=1 do the direct method.
● NOTE: When you need to borrow while performing a If subtrahend > minuend, it is REQUIRED to do
subtraction, always borrow from the nearest "1" digit. either 1’s or 2’s complement.
Change the "1" to "0," and the digit that borrowed will
get 2. However, it's essential to keep in mind that the
digit receiving the 2 won't just get it directly. We need 3. Octal
to consider the other digits between the "1" and the ● Subtracting with a base of 8.
"0." This process involves continuous subtraction to ● When the subtrahend > minuend, borrow 1 from the
ensure accuracy. next place value (to the left) and add the base (8) to
Ex. the minuend. This adjustment allows for the
subtraction of the two place values.
● If the entire subtrahend > minuend, the difference is
automatically negative, but to subtract the two,
switch the minuend and subtrahend.

347.22 – 772.51 = ?
67658 455.758
1’S AND 2’S COMPLEMENT
47748 172.268 772.518
1’S COMPLEMENT 17718 263.478 347.228
-423.278
Steps:
1. Inverse the values of the subtrahend.
2. Add the minuend with the inversed subtrahend. 4. Hexadecimal
3. Inverse the sum from Step 2. ● Subtracting with a base of 16.
4. Check the signs of the value ● When the subtrahend > minuend, borrow 1 from the
If (subtrahend > minuend) = negative next place value (to the left) and add the base (16) to
If (minuend > subtrahend) = positive the minuend. This adjustment allows for the
subtraction of the two place values.
NOTE: When performing addition, disregard the extra carry.
● If the entire subtrahend > minuend, the difference is
Ex. 10110012 – 11100012 = ? automatically negative, but to subtract the two,
switch the minuend and subtrahend.
11100012 ~ 00011102
1011001 11001112 ~ 00110002
+ 0001110 CBA.BB – FFC.D5 = ?
10110012 – 11100012 = −𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟐𝟐 4D5E16 DDA.BF16
1100111 3AB16 CBD.EA16 FFC.D516
49B316 11C.D516 CBA.BB16
-342.1A16
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

DATA REPRESENTATION BINARY DIGIT REPRESENTATION

Sign-magnitude Representation
• Computers and other digital circuits process data in binary
format. ● An additional bit is used as the sign bit, usually placed as the
• Various binary codes are used to represent data which may MSB (most significant bit) (unahan).
be numeric, alphabetic, or special characters. ● Requires binary conversion, not BCD.
• In digital systems in every code used, the information is
represented in binary form, but the interpretation of the data
● Sign bits: 0 if positive, 1 if negative.
is only possible if the code in which the data is being
Ex. Represent +27 and -27 in sign-magnitude representation.
processed is known.

DECIMAL DIGIT REPRESENTATION

Binary Coded Decimal (BCD)


● Coding scheme relating decimal and binary numbers.
● Four (4) bits are required to code each decimal number.
● 1:4 (one digit, four bits binary [8,4,2,1])
● Same lang yung format sa binary-converted pag 0-9, but once
na umabot sa n > 9, the values will be different.
● Ex. 24 to binary-converted = 110002 Absolute Value Representation
BCD format = 0010 0100
● 8-bit representation ONLY (including the sign).
● Ranges between +127 to -127.
Unpacked Decimal Format (UDF) ● Same process as sign-magnitude, but only with 8-bits.
● Uses zoned digits to represent a number.
Ex. Represent +37 and -83 in sign magnitude representation.
● 1 byte for each decimal digit (8 bits each)
● 4 MSB can be zoned bits (1111) or signed bits:
o 1100 if positive; 1101 if negative
● 4 LSB represent the number (1:4 BCD)
● Basically, BCD with extra steps: plus the zoned bits

Ex. Represent 324 to UDF

Complement Representation
● Two kinds: 1’s complement and 2’s complement.
● 1’s complement: directly inverses the binary.
● 2’s complement: Inverses and add 1 to the binary.

Ex. Represent 101101102 in Complement Representation


Packed Decimal Format (UDF)
● Uses 8-bits to represent 2 decimal numbers.
● Still uses sign zoned bits: 1100 if +, 1101 if –
● Condensed version of UDF.

Ex. Represent -3384 to PDF

NOTE: whenever adding or subtracting decimals and radix, only


use sign magnitudes when instructed to.
• Hindi siya basta-basta nilalagyan ng 0 or 1 sa harap
(you can’t assume the value agad).
• Kapag negative yung given, we can use sign
magnitudes to represent.

NOTE: The end pair must be LSB + (sign bit), which is constant.
If the number of digits is even, add zero before the MSB to make
the LSB + (sign bit) tandem. (arte amp)
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas

FLOATING-POINT REPRESENTATION
● ASCII allows computers to understand how
• Computers represent real values in a form like that of scientific to represent text.
notation. ● Each character is represented by a binary
• There are standards which define what the representation value, and each character is assigned a
means so that across computers, there will be consistency. unique number between 0 and 127.
• This is the only way to represent floating point numbers
(standard way of IEEE).

Floating-point Representation
● 8-bit representation
Extended Binary ● Plus 1-bit for parity (odd/even)
● 32-bit representation
Coded Decimal ● EBCDIC is a character encoding scheme
● Sign bit (1-bit): positive (0), negative (1) Interchange Code used to represent text and control
● Exponent: 8-bits (sign-bit included) (EBCDIC) characters in computing systems. It is
● Mantissa: 23-bits (if kulang, fill with 0s). primarily used on IBM mainframe and IBM
o Mantissa – Latin term meaning “an addition, a midrange computer systems.
makeweight, or something of minor value.
● 7-bit representation
Visual representation of floating-point representation:
● Used for representing dates and times in a
standardized way that's clear and
sb e hb m understandable to both people and
International machines.
Standards ● It uses a general-to-specific approach, with
Where: Organization (ISO)
• sb – signed-bit the year first, followed by the month, and
• e – exponent then the day.
• hb – hidden bit ● Example: July 15, 2022, is represented as
• m - mantissa 20220715 or 2022-07-15.

STEPS IN FLOATING POINT REPRESENTATION


● 16-bit representation
1. Convert the number to binary (if binary already, skip step 1)
2. Represent the number in scientific notation. Japan Industrial ● Japanese language has three systems of
3. Represent the exponent in binary form. Standards (JIS) writing with different characters (hiragana,
4. Complete the floating-point representation. katakana, kanji), making the Japanese
language in a separate representation type.

NOTE:
• Movement of decimal point: ● 16-bit representation
• Right to left (←) – positive exponent ● Standard encoding system that represents
(stop before the nearest 1) characters from most languages.
• Left to right (→) – negative exponent Unicode ● It's used to encode the majority of text on
(stop after the nearest 1) the internet, including most web pages.
• In exponent, 127 is constant (to fill the 8-bit).
● Unicode is also the preferred character set
for the internet, especially for HTML and
Ex. Represent 11101011.10102 in floating-point. XML.

1. Represent the number in scientific notation.


ASCII EBCDIC
11101011.10102 → 1.110101110102 Character
Code Zone Digit
(moved 7 units to the left) = 1.11010111010 x 27 A–I 65 – 73 12 1-9
2. Represent the exponent in binary form. J–R 74 – 82 13 1-9
S–Z 83 – 90 14 2-9
𝑒𝑒 = 7 + 127 = 134
Convert to binary: a–i 97 – 105 8 1-9

134 = 1 0 0 0 0 1 1 0 j-r 106 – 114 9 1-9


128 64 32 16 8 4 2 1 s–z 115 – 122 10 2-9
𝑒𝑒 = 100001102 0–9 48 – 57 15 0-9
space 32 4 0
3. Complete the floating-point

Parity bit
0 10000110 (1) REPRESENTATION
CHARACTER 110101110100000000000002
● A parity bit is an extra bit added in a string of binary code to make
the total of 1s either odd or even. Two types of parity bit:
TYPES OF CHARACTER REPRESENTATION ● Even parity – count the number of 1’s; if even, parity bit is 0, if
odd, parity bit is 1.
American Standard ● Odd parity – count the number of 1’s; if odd, parity bit is 0, if
Code for Information
● 7-bit representation
even, parity bit is 1.
Interchange (ASCII) ● Plus 1-bit for parity (odd/even)

You might also like