You are on page 1of 58

COMPUTER

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

• Mac - uses the


Macintosh operating
system
How Does My Computer Work?
• The “brain” of a computer is the central processing unit (CPU).
When the CPU receives and carries out an instruction, it has
completed one cycle.

• Computer’s speed = number of cycles completed in one


second

• Cycles are measured in:


• Megahertz (MHz) = millions of cycles per second
• Gigahertz (GHz) = billions of cycles per second
BINARY CODE
• Computers use a special code of their own to express the digital
information they process.
• It's called the binary code because it consists of only two symbols—0s and
1s. (The "bi" in "binary" means two.)

• 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.

• A Byte is equal to 8 Bits.


• A Byte can represent 256 states of information, for example, numbers or a
combination of numbers and letters. 1 Byte could be equal to one character. 10
Bytes could be equal to a word. 100 Bytes would equal an average sentence.
How Big Is a Terabyte?
Common storage units:
• 1 bit = a binary digit
• 8 bits = 1 byte
• 1024 bytes = 1 kilobyte
• 1024 kilobytes = 1 Megabyte
• 1024 Megabytes = 1 Gigabyte
• 1024 Gigabytes = 1 Terabyte
Understanding Binary Numbers
If you have ever seen the movie “The Matrix” and enjoyed
thinking about how it all works; jumping in and out of a
computer program etc… Then you know something about
conceptualizing.
To form (a concept or concepts) out of observations,
experience, data, etc.

When you use your brain to visualize something that is


abstract or on the surface a bit difficult to see in your mind.
George Boole
• In 1854, British mathematician George
Boole published a landmark paper
detailing an algebraic system of logic
that would become known as Boolean
algebra.
• His logical calculus was to become
instrumental in the design of digital
electronic circuitry.
George Stibitz
• In November 1937, George Stibitz,
then working at Bell Labs, completed
a relay-based computer he dubbed the
"Model K" (for “Kitchen", where he
had assembled it), which calculated
using binary addition. Bell Labs thus
authorized a full research program in
late 1938 with Stibitz at the helm.
• Who can guess when the
first machine was able to
send data over a phone
line?
George Stibitz
•Their Complex Number Computer,
completed January 8, 1940, was able to
calculate complex numbers. In a
demonstration to the American Mathematical
Society conference at Dartmouth College on
September 11, 1940, Stibitz was able to send
the
•Complex Number Calculator remote
commands over telephone lines by a
teletype. It was the first computing machine
ever used remotely over a phone line.
•Model K The first Relay Based Computer to
use Binary Numbers (1937)
Decimal Number System

• Decimal notation is the writing of numbers in a


base-10 numeral system.
• Examples are Roman numerals, Brahmi
numerals, and Chinese numerals, as well as the
Hindu-Arabic numerals used by speakers of
English.
Decimal Number System

• Decimal notation is the writing of numbers in a


base-10 numeral system.
• Examples are Roman numerals, Brahmi
numerals, and Chinese numerals, as well as the
Hindu-Arabic numerals used by speakers of
English.
Why do we need to know about Binary?
• It is the building block of all data

• In order to understand storage capacity and


sizes, you need to know how data is read and
saved

• The data is fragile, each digit is need to be


whole
Files Read/Write
• When you save a word document the computer will
sequence the data in binary form. Each string of digits
represent a certain value such as a letter, space,
underlined etc.

• Each program has a certain way that it reads and


writes data, all of it is written in Binary.
Understanding Binary
Decimal 1
Binary 0001

off off off on


Understanding Binary
Decimal 2
Binary 0010

off off on off


Understanding Binary
Understanding Binary
Understanding Binary
Bits
•0 = 0
•1 = 1 • 7 = 111
• 2 = 10 • 8 = 1000
• 3 = 11 • 9 = 1001
• 4 = 100 • 10 = 1010
• 5 = 101 • 11 = 1011
• 6 = 110 • 12 = 1100
Binary arithmetic operation
• Look at adder in binary and decimal
3
+3
=6

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.

• Hint: you can open and close your eyes to code


different information.
• With 8 bits in a byte, you can represent 256
values ranging from 0 to 255, as shown here:
• 0 = 00000000
• 1 = 00000001
• 2 = 00000010
• 254 = 11111110
• 255 = 11111111
• This is related to ASCII code!
ASCII
• It is an acronym for the American Standard Code for
Information Interchange.
• It is a standard seven-bit code that was first proposed
by the American National Standards Institute or ANSI
in 1963, and finalized in 1968 as ANSI Standard
X3.4.
• The purpose of ASCII was to provide a standard to
code various symbols ( visible and invisible
symbols)
ASCII
• In the ASCII character set, each binary value
between 0 and 127 represents a specific
character.
• Most computers extend the ASCII character set
to use the full range of 256 characters available
in a byte. The upper 128 characters handle
special things like accented characters from
common foreign languages.
Bytes: ASCII
• By looking at the ASCII table, you can clearly see a
one-to-one correspondence between each character
and the ASCII code used.
• For example, 32 is the ASCII code for a space.
• We could expand these decimal numbers out to binary
numbers (so 32 = 00100000), if we wanted to be
technically correct -- that is how the computer really
deals with things.
Bytes: ASCII
• Computers store text documents, both on disk and in memory, using these ASCII
codes.
• For example, if you use Notepad in Windows XP/2000 to create a text file
containing the words, "Four score and seven years ago," Notepad would use 1
byte of memory per character (including 1 byte for each space character between
the words -- ASCII character 32).

• 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!

You might also like