Lesson 2 - Computer Basics
Lesson 2 - Computer Basics
BASIC
OBJECTIVES:
BOOTING
• In computing, booting is the process
of starting a computer. It can be
initiated by hardware such as a button
press, or by a software command.
• After it is switched on, a computer's
central processing unit has no
software in its main memory, so some
process must load software into
memory before it can be executed.
TYPES OF BOOTING
• Cold Boot – turning on
your computer (pressing
the Power button).
• Warm Boot – Restarting
your computer (pressing
the Reset button).
COMPONENTS OF A COMPUTER
SYSTEM
• Hardware– a
tangible feature of a
computer system.
COMPONENTS OF A COMPUTER
SYSTEM
• Software–refers to
intangible element of
a computer system
or programs that
instruct the computer
on what to do.
COMPONENTS OF A COMPUTER
SYSTEM
• Peopleware– refers
to people who works
or operates on a
computer, such as
programmers and
data encoders.
COMPONENTS OF A COMPUTER
SYSTEM
• Firmware– the place
where computing
occurs (office,
military bases).
• Personal Computer-
uses the Microsoft
Windows operating
system
• Why 0s and 1s? the only two numbers you need to express the flow of
electricity through a transistor. It's either on or it's off. On is 1, off is 0.
Everything you say to a computer has to be put in terms of these two
numbers.
Bits and Bytes
• Bits and bytes are small pieces of computerized data that communicate
commands to a computer’s CPU:
• A bit is either a 1 or a 0 (binary digits).
• A byte contains eight bits.
• Each letter in the English language is represented by
one byte.
11
+ 11
• =110 (carry) which is 6 in decimal.
More binary operations
• Likewise, other arithmetic operations such as
subtraction, multiplication and division, as well as other
logical operations can all be accomplished electronically
in CPUs, but more complicated than binary adder.
• You just need to know that binary numbers can represent
everything, support a complete set of arithmetic and
logic operations. (Not the concentration of this class,
take introduction to computer science or architecture
course if want to explore more such as binary
complementary code etc.!)
More binary operations
• As you can see, numbers can become rather
long and appear to be cumbersome in the binary
system. For example, to show the number 10,
we need four light switches, or four places.
• However, it is not a problem to computers at all!
Because the real switches inside a computer are
tiny and they are able to turn on and off very
rapidly.
The Hexadecimal System
• Although not a problem internally, long binary number
seems a problem to display in some situations. A common
practice to solve this problem is to use hexadecimal to
represent Binary numbers more compactly externally.
• The hexadecimal system is base 16. Therefore, it requires
16 different symbols. The values 0 through 9 are used,
along with the letters A through F, which represent the
decimal values 10 through 15.
0..9, A, B, C, D, E, F
0..9, 10, 11, 12,13, 14, 15
Hexadecimal <->binary
binary Hexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F
Hex decimal binary
10 16 10000
F0 240 11110000
FF 255 11111111
Hexadecimal <->binary
• Group binary number 4 by 4 starting from the
least significant position.
The Octal System
• The Octal system is base 8. Therefore it requires
8 digits. The values 0 through 7 are used.
• Octal to hexadecimal conversion, or visa versa,
is most easily performed by first converting to
binary.
• A binary number is converted to octal by
grouping the bits in groups of three.
• The binary, hexadecimal (hex) and octal system
share one common feature – they are all based
on powers of 2.
• Each digit in the hex system is equivalent to a
four-digit binary number and each digit in the
octal system is equivalent to a 3-digit binary
number.
A Bit
• A ‘bit’ (from Binary + digIT) is the smallest unit of
memory, also the unit of measurement of data
information.
A Bytes
• Since a single bit holds so little information, bits are
rarely seen alone in computers. They are almost
always bundled together into 8-bit collections, and
these collections are called bytes.
• Bytes, larger units, then are treated as integral units
of storage.
Words
• On most machines, “bytes” are assembled into
larger structures called “words”, where a word
is usually defined to be the size required to hold
an integer value.
• Some machines use two-byte words (16 bits),
while some others use 4-byte words(32 bits) and
some machines use less conventional sizes.
Why are there 8 bits in a byte?
• A similar question is, "Why are there 12 eggs in a dozen?"
• Why your table has no larger or smaller working area?
• It targets at the most common situation.
• The 8-bit byte is something that people settled on through trial and
error over the past 50 years.
• To some extend, 8-bit is enough to represent all English characters
and Arabic numbers. A byte used to be the basic unit to hold an
individual character in a text document.
Questions
• Can you use your one eye to show yes or no?
• Can you use your two eyes to represent four
directions, north, east, south and west to your
partner.
• When Notepad stores the sentence in a file on disk, the file will also contain 1
byte per character and per space.
• Binary number is usually displayed as Hexadecimal to save display space.
• Take a look at a file size now.
• Take a look at the space of your p drive
Bytes: ASCII
• If you were to look at the file as a computer looks at
it, you would find that each byte contains not a letter
but a number -- the number is the ASCII code
corresponding to the character (see below). So on
disk, the numbers for the file look like this:
•F o u r a n d s e v e n
• 70 111 117 114 32 97 110 100 32 115 101 118 101
110
Bytes: ASCII
• Externally, it appears that human beings will use
natural languages symbols to communicate with
computer.
• But internally, computer will convert everything into
binary data.
• Then process all information in binary world.
• Finally, computer will convert binary information
back to symbols understandable to human beings .
Bytes: ASCII
• When you type the letter A, the hardware logic
built into the keyboard automatically translates
that character into the ASCII code 65, which is
then sent to the computer. Similarly, when the
computer sends the ASCII code 65 to output
devices, the output hardware instead draw letter
“A” on your screen or your computer.
Revisit “char” data type
• In C++, single characters are represented using
the data type char, which is one of the most
important scalar data types.
• char achar;
• achar=‘A’;
• achar=65;
Character and integer
• A character and an integer (actually a small
integer spanning only 8 bits) are actually
indistinguishable on their own.
• If you want to use it as a char, it will be a char,
if you want to use it as an integer, it will be an
integer, as long as you know how to use proper
C++ statements to express your intentions.
• 1 bit
• 1 byte = 8 bits
• 1 kb = 210 bytes = 1024 bytes !=1000
• 1 Mb = 1 k k bytes = 210 * 210 bytes
• 1 G b = 210 * 210 * 210 bytes
• 1 Terab = 210 * 210 * 210 * 210 bytes
Even larger capacity
• 1 petabyte = 210 * 210 * 210 * 210 * 210 bytes
(2 to the 50th power )
• 1 exabyte= 260
• 1 zettabyte = 270
• 1 yottabyte = 280
Some interesting facts about what these
various-sized bytes can store:
• 1 bit: a binary decision
• 1 byte: a character
• 5 Megabytes: The complete works of Shakespeare
• 2 Gigabytes: 20 meters of shelved books
• 10 Terabytes: The printed collection of the US Library of Congress
• 200 Petabytes: All printed material in the whole word.
• 5 Exabytes: All words ever spoken by human beings
CPU processes binary number
• The first microprocessor to make it into a home
computer was the Intel 8080, a complete 8-bit
computer on one chip, introduced in 1974.
CPU processes binary number
• PC market moved from the 8088 to the 80286, the 80386,
80486, the Pentium, the Pentium II to the Pentium III to the
Pentium 4.
• All of these microprocessors are made by Intel and all of
them are improvements on the basic design of the 8088.
• The Pentium 4 can execute any piece of code that ran on the
original 8088, but it does it about 5,000 times faster!