Professional Documents
Culture Documents
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
Bottom to top
Bottom to top
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
0.696 = 0.101100102
1ST SEMESTER: MIDTERMS EXAMINATION
ITC – INTRODUCTION TO COMPUTING (COMP 001)
Geuel John D. Rivera | BSCS 1-5 | Prof. Melvin Roxas
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
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.
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.
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.
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.
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)