Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

CFP Module 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

BICOL UNIVERSITY COLLEGE OF ENGINEERING

MECHANICAL ENGINEERING DEPARTMENT

I N T R O D U C T I O N T O

COMPUTER
FUNDAMENTALS
&
PROGRAMMING
FOR BS MECHANICAL ENGINEERING

ENGR. MARY JOY R. MANDANE


INSTRUCTOR 1
INTRODUCTION TO computers

s t
tee m
m s
s
err SSyy s
Nuum
m b
b e
N D a
attaa
& D
&
o n
nss
enntta
a tti
i o
eppr
r e
esse
RR e module 2

ENGR. MARY JOY R. MANDANE


INSTRUCTOR 1
yOU WILL BE ABLE TO LEARN:
number system
data representation
"In all your ways submit to him, and he will
make your paths straight" - Prov. 3:6

GAME TIME!!!
4 Pics and 1 Word
While taking up this module, you need to answer this game correctly. In every page, I will give you a
LETTER as a clue. At the end of the module, you will receive the final instruction.

ENGR. MARY JOY MANDANE - PAGE 1


Key to Correction
INSTRUCTION: Screenshot the answer that you submitted to your professor, then put or
using the "pen" of FB messenger. Finally, please indicate there the score you got. Do it with
integrity and honesty. Not following instruction will be considered zero.

NOTE: The correct answers are indicated below. (It is already arrange according to its correct formation.)

20/20

E-READER

HEADPHONES

PLUS FOUR POINTS FOR HONESTY AND INTEGRITY

ENGR. MARY JOY MANDANE - PAGE 2


NUMBER SYSTEMS
SOURCE: https://www.tutorialspoint.com/computer_fundamentals/computer_number_system.htm
https://www.tutorialspoint.com/computer_fundamentals/computer_number_conversion.htm
NUMBER SYSTEM
The technique to represent and work with numbers is called number system. Decimal number system
is the most common number system. Other popular number systems include binary number system,
octal number system, hexadecimal number system, etc.
When we type some letters or words, the computer translates them in numbers as computers can
understand only numbers. A computer can understand the positional number system where there are
only a few symbols called digits and these symbols represent different values depending on the position
they occupy in the number.
The value of each digit in a number can be determined using −

The digit
The position of the digit in the number
The base of the number system (where the base is defined as the total number of digits available in
the number system)
Decimal Number System
Decimal number system is a base 10 number system having 10 digits from 0 to 9. This means that any
numerical quantity can be represented using these 10 digits. Decimal number system is also a
positional value system. This means that the value of digits will depend on its position. Let us take an
example to understand this.
The decimal number 1234 consists of the digit 4 in the units position, 3 in the tens position, 2 in the
hundreds position, and 1 in the thousands position. Its value can be written as

Binary Number System


The easiest way to vary instructions through electric signals is two-state system – on and off. On is
represented as 1 and off as 0, though 0 is not actually no signal but signal at a lower voltage. The
number system having just these two digits – 0 and 1 – is called binary number system.
Each binary digit is also called a bit. Binary number system is also positional value system, where each
digit has a value expressed in powers of 2, as displayed here.

ENGR. MARY JOY MANDANE - PAGE 3


In any binary number, the rightmost digit is called least significant bit (LSB) and leftmost digit is
called most significant bit (MSB).

And decimal equivalent of this number is sum of product of each digit with its positional value.

Characteristics of the binary number system are as follows −


Uses two digits, 0 and 1
Also called as base 2 number system
Each position in a binary number represents a 0 power of the base (2). Example 20
Last position in a binary number represents a x power of the base (2). Example 2x where x
represents the last position - 1.
Example
Binary Number:

Calculating Decimal Equivalent −

Computer memory is measured in terms of how many bits it can store. Here is a chart for memory
capacity conversion.
--1 byte (B) = 8 bits
--1 Kilobytes (KB) = 1024 bytes
--1 Megabyte (MB) = 1024 KB
--1 Gigabyte (GB) = 1024 MB
--1 Terabyte (TB) = 1024 GB
--1 Exabyte (EB) = 1024 PB
--1 Zettabyte = 1024 EB
--1 Yottabyte (YB) = 1024 ZB

ENGR. MARY JOY MANDANE - PAGE 4


Octal Number System
Octal number system has eight digits – 0, 1, 2, 3, 4, 5, 6 and 7. Octal number system is also a
positional value system with where each digit has its value expressed in powers of 8, as shown here −

Decimal equivalent of any octal number is sum of product of each digit with its positional value.

Characteristics of the octal number system are as follows −

Uses eight digits, 0,1,2,3,4,5,6,7


Also called as base 8 number system
Each position in an octal number represents a 0 power of the base (8). Example 80
Last position in an octal number represents a x power of the base (8). Example 8x where x
represents the last position - 1
Example
Octal Number:
Calculating Decimal Equivalent −

Hexadecimal Number System


Hexadecimal number system has 16 symbols – 0 to 9 and A to F where A is equal to 10, B is equal to 11
and so on till F. Hexadecimal number system is also a positional value system with where each digit
has its value expressed in powers of 16, as shown here −

ENGR. MARY JOY MANDANE - PAGE 5


Characteristics of hexadecimal number system are as follows −

Uses 10 digits and 6 letters, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F


Letters represent the numbers starting from 10. A = 10. B = 11, C = 12, D = 13, E = 14, F = 15
Also called as base 16 number system
Each position in a hexadecimal number represents a 0 power of the base (16). Example, 160
Last position in a hexadecimal number represents a x power of the base (16). Example 16x
where x represents the last position - 1

Decimal equivalent of any hexadecimal number is sum of product of each digit with its positional value.

Example
Hexadecimal Number:
Calculating Decimal Equivalent −

Number System Relationship


The following table depicts the relationship between decimal, binary, octal and hexadecimal number
systems.

O
ENGR. MARY JOY MANDANE - PAGE 6
There are many methods or techniques which can be used to convert numbers from one base to
another. In this chapter, we'll demonstrate the following −
Decimal to Other Base System
Other Base System to Decimal
Other Base System to Non-Decimal
Shortcut method - Binary to Octal
Shortcut method - Octal to Binary
Shortcut method - Binary to Hexadecimal
Shortcut method - Hexadecimal to Binary

Decimal to Other Base System


Step 1 − Divide the decimal number to be converted by the value of the new base.
Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant digit) of the new base number.
Step 3 − Divide the quotient of the previous divide by the new base.
Step 4 − Record the remainder from Step 3 as the next digit (to the left) of the new base number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes zero in Step 3.
The last remainder thus obtained will be the Most Significant Digit (MSD) of the new base number.

Example
Decimal Number:
Calculating Binary Equivalent −

ENGR. MARY JOY MANDANE - PAGE 7


As mentioned in Steps 2 and 4, the remainders have to be arranged in the reverse order so that the first
remainder becomes the Least Significant Digit (LSD) and the last remainder becomes the Most
Significant Digit (MSD).

Other Base System to Decimal System


Step 1 − Determine the column (positional) value of each digit (this depends on the position of the digit
and the base of the number system).
Step 2 − Multiply the obtained column values (in Step 1) by the digits in the corresponding columns.
Step 3 − Sum the products calculated in Step 2. The total is the equivalent value in decimal.

Example
Binary Number:
Calculating Decimal Equivalent −

Other Base System to Non-Decimal System


Step 1 − Convert the original number to a decimal number (base 10).

Step 2 − Convert the decimal number so obtained to the new base number.
Example
Octal Number :
Calculating Binary Equivalent −
Step 1 - Convert to Decimal

R
ENGR. MARY JOY MANDANE - PAGE 8
Step 2 - Convert Decimal to Binary

Shortcut Method ─ Binary to Octal


Step 1 − Divide the binary digits into groups of three (starting from the right).
Step 2 − Convert each group of three binary digits to one octal digit.
Example
Binary Number :
Calculating Octal Equivalent −

Shortcut Method ─ Octal to Binary


Step 1 − Convert each octal digit to a 3-digit binary number (the octal digits may be treated as decimal
for this conversion).
Step 2 − Combine all the resulting binary groups (of 3 digits each) into a single binary number.
Example
Octal Number :
Calculating Binary Equivalent −

ENGR. MARY JOY MANDANE - PAGE 9


Shortcut Method ─ Binary to Hexadecimal
Step 1 − Divide the binary digits into groups of four (starting from the right).
Step 2 − Convert each group of four binary digits to one hexadecimal symbol.
Example
Binary Number :
Calculating hexadecimal Equivalent −

Shortcut Method - Hexadecimal to Binary


Step 1 − Convert each hexadecimal digit to a 4-digit binary number (the hexadecimal digits may be
treated as decimal for this conversion).
Step 2 − Combine all the resulting binary groups (of 4 digits each) into a single binary number.
Example
Hexadecimal Number :
Calculating Binary Equivalent −

ASCII
Besides numerical data, computer must be able to handle alphabets, punctuation marks, mathematical
operators, special symbols, etc. that form the complete character set of English language. The complete
set of characters or symbols are called alphanumeric codes. The complete alphanumeric code typically
includes −
26 upper case letters
26 lower case letters
10 digits
7 punctuation marks

A
20 to 40 special characters

ENGR. MARY JOY MANDANE - PAGE 10


Now a computer understands only numeric values, whatever the number system used. So all
characters must have a numeric equivalent called the alphanumeric code. The most widely used
alphanumeric code is American Standard Code for Information Interchange (ASCII). ASCII is a 7-
bit code that has 128 (27) possible codes.

ENGR. MARY JOY MANDANE - PAGE 11


DATA REPRESENTATION
SOURCE: https://home.adelphi.edu/
• Data refers to the symbols that represent people, events, things, and ideas. Data can be a name, a
number, the colors in a photograph, or the notes in a musical composition.
• Data Representation refers to the form in which data is stored, processed, and transmitted.
• Devices such as smartphones, iPods, and computers store data in digital formats that can be
handled by electronic circuitry.
• Digitization is the process of converting information, such as text, numbers, photo, or music, into
digital data that can be manipulated by electronic devices.
• The Digital Revolution has evolved through four phases, beginning with big, expensive,
standalone computers, and progressing to today’s digital world in which small, inexpensive digital
devices are everywhere.
• The 0s and 1s used to represent digital data are referred to as binary digits — from this
term we get the word bit that stands for binary digit.
• A bit is a 0 or 1 used in the digital representation of data.
• A digital file, usually referred to simply as a file, is a named collection of data that exits on a
storage medium, such as a hard disk, CD, DVD, or flash drive.

DATA REPRESENTATION

E
ENGR. MARY JOY MANDANE - PAGE 12
• Numeric data consists of numbers that can be used in arithmetic operations.
• Digital devices represent numeric data using the binary number system, also called base 2.
• The binary number system only has two digits: 0 and 1.
• No numeral like 2 exists in the system, so the number “two” is represented in binary as 10
(pronounced “one zero”).

Representing Text
• Character data is composed of letters, symbols, and numerals that are not used in calculations.
• Examples of character data include your name, address, and hair color.
• Character data is commonly referred to as “text.”
• Digital devices employ several types of codes to represent character data, including ASCII, Unicode,
and their variants.
• ASCII (American Standard Code for Information Interchange, pronounced “ASK ee”) requires seven
bits for each character.
• The ASCII code for an uppercase A is 1000001.
• Extended ASCII is a superset of ASCII that uses eight bits for each character.
• For example, Extended ASCII represents the uppercase letter A as 01000001.
• Using eight bits instead of seven bits allows Extended ASCII to provide codes for 256 characters.
• Unicode (pronounced “YOU ni code”) uses sixteen bits and provides codes or 65,000 characters.
• This is a bonus for representing the alphabets of multiple languages.
• UTF-8 is a variable-length coding scheme that uses seven bits for common ASCII characters but uses
sixteen-bit Unicode as necessary.

ENGR. MARY JOY MANDANE - PAGE 13


• ASCII codes are used for numerals, such as Social Security numbers and phone numbers.

• Plain, unformatted text is sometimes called ASCII text and is stored in a so-called text file with a name
ending in .txt.
• On Apple devices these files are labeled “Plain Text.” In Windows, these files are labeled “Text
Document”.
• ASCII text files contain no formatting.
• To create documents with styles and formats, formatting codes have to be embedded in the text.
• Microsoft Word produces formatted text and creates documents in DOCX format.
• Apple Pages produces documents in PAGES format.
• Adobe Acrobat produces documents in PDF format.
• HTML markup language used for Web pages produces documents in HTML format.

W
ENGR. MARY JOY MANDANE - PAGE 14
Bites and Bytes
• All of the data stored and transmitted by digital devices is encoded as bits.

• Terminology related to bits and bytes is extensively used to describe storage capacity and network
access speed.
• The word bit, an abbreviation for binary digit, can be further abbreviated as a lowercase b.
• A group of eight bits is called a byte and is usually abbreviated as an uppercase B.
• When reading about digital devices, you’ll frequently encounter references such as 90 kilobits per
second, 1.44 megabytes, 2.8 gigahertz, and 2 terabytes.
• Kilo, mega, giga, tera, and similar terms are used to quantify digital data.

K
ENGR. MARY JOY MANDANE - PAGE 15
• Use bits for data rates, such as Internet connection speeds, and movie download speeds.
• Use bytes for file sizes and storage capacities.

• 104 KB: Kilobyte (KB or Kbyte) is often used when referring to the size of small computer files.
• 56 Kbps: Kilobit (Kb or Kbit) can be used for slow data rates, such as a 56 Kbps (kilobits per second)
dial-up connection.
• 50 Mbps: Megabit (Mb or Mbit) is used for faster data rates, such as a 50 Mbps (megabits per second)
Internet connection.
• 3.2 MB: Megabyte (MB or MByte) is typically used when referring to the size of files containing
photos and videos.
• 100 Gbit: Gigabit (Gb or Gbit) is used for really fast network speeds.
• 16 GB: Gigabyte (GB or GByte) is commonly used to refer to storage capacity

Data Compression
• To reduce file size and transmission times, digital data can be compressed.
• Data compression refers to any technique that recodes the data in a file so that it contains fewer bits.
• Compression is commonly referred to as “zipping.”
• Compression techniques divided into two categories: lossless and lossy
• Lossless compression provides a way to compress data and reconstitute it into its original state
uncompressed data stays exactly the same as the original data
• Lossy compression throws away some of the original data during the compression process;
uncompressed data is not exactly the same as the original
• Software for compressing data is sometimes referred to as a compression utility or a zip tool.
• On laptops and desktop computers, the compression utility is accessed from the same screen used to
manage files.

M
ENGR. MARY JOY MANDANE - PAGE 16
• The process of reconstituting files is called extracting or unzipping.
• Compressed files may end with a .zip, .gz, pkg, or.tar.gz.

T
ENGR. MARY JOY MANDANE - PAGE 17
INDIVIDUAL OUTPUT 1
OUTPUT
INSTRUCTION:
1. Get your short coupon bond/yellow pad
2. At the upper of the paper, write this format:

SURNAME, FULL NAME BLOCK/SECTION INDIVIDUAL OUTPUT 1 DATE


3.Open this link: http://www.jprodriguez.net/csc212/lectures/Chap01Q.pdf
4. As you can see there is 132 multiple choice questions with key to corrections.
5. Choose at least maximum 50 questions related with conversion of number systems.
6. Answer at least maximum 50 questions with given, required and solution.
7. For the solution, review the lessons on how to convert the number system in computer.
8. To verify your answer, check the key to corrections.
9. You should do this on hand written.
10. Strictly, no copying to other.
11. Scan your outputs then send to our google classroom.
12. Notify your professor if you already submitted the output.
13. The deadline of submission is October 10, 2020, 11:59 pm

ENGR. MARY JOY MANDANE - PAGE 18


4 PICS & 1 WORD

If you get the correct answer, that is your last clue for your project!
Proceed to the next module to know your first project!

ENGR. MARY JOY MANDANE - PAGE 19

You might also like