binary system

Download Report

Transcript binary system

Base 2 Numbering System
Chapter 1
Binary and Character Encoding
• Modern humans use character sets (or
alphabets) to represent written sounds and
words. Each symbol or letter has its own
phonetic sound. The letter (or combination of
letters, such as “ph”) is paired to its
corresponding sound, forming a character code.
It is through the combination of symbols or
letters that words are generated and phrases,
and ultimately complex communication.
Computer to Computer
Communication
• Computers, however, have yet to evolve to a level
capable of exactly duplicating the complex processingconsistently-and-reliably-of the human brain. Currently,
computers can best communicate with other
computers in a manner based upon the principles of
fundamental Mathematics. Computer to human
communication, while having evolved to a certain
degree of voice replication, and other advances, it is
still based upon the principles of fundamentals
mathematics.
Binary Number System
The current methodology for digital data
transfer is called binary, and it is the basis for all
computing technology.
To understand how computers handle, move,
store, access, save, delete or otherwise
manipulate data, you must understand the
binary system.
What is Binary?
• Binary is the name given to a Base 2 numbering
system or encoding scheme. As the name Base 2
implies, there are two and only two possible
states (1 or 0). This encoding scheme works well
with electronic communication. There are only
two states (on or off, yes or no, 1 or 0, open or
close). If you’re talking about circuits open and
closed works well
Communication in a Two State Universe
• Communication in a two-state environment is
now possible. (yes or no, on or off, 1 or 0).
This is important being that presently
computer essentially pass or store information
as either electrical or magnetic states.
Electricity and Magnetism
• Magnetism – is the force whereby objects are
attracted to or repelled by one another.
Usually these objects are metal such as iron.
• Magnetism can
1. Store electricity (aka battery)
2. Generate electricity (aka generator)
Magnetism has Two States
• Two states or opposing poles
1. Positive
2. Negative
• Magnetic states can also be contained or
preserved.
Similarities between magnetic fields and
electric fields:
• Electric fields are produced by two kinds of charges, positive and negative.
Magnetic fields are associated with two magnetic poles, north and south,
although they are also produced by charges (but moving charges).
• Like poles repel; unlike poles attract
• Electric field points in the direction of the force experienced by a positive
charge. Magnetic field points in the direction of the force experienced by a
north pole.
• Differences between magnetic fields and electric fields:
– Positive and negative charges can exist separately. North and South
poles always come together.
– Electric field lines have definite starting and ending points. Magnetic
field lines are continuous loops. Outside a magnet the field is directed
from the north pole to the south pole. Inside a magnet the field runs
from south to north.
Magnetic Domain
Magnetic Domain – is a series of atoms that
point their poles in the same direction.
Example: Direction of an iron oxide shaving
can be manipulated by a magnet.
Bar Magnet
• Is made up of a group of domains.
• The most common source of magnetic fields
is the electric current loop.
• Electricity is the type of activity arising from
the existence of charge. The basic unit of
charge is that on the:
– Proton – positive
– Electron - negative
Electricity
• Electricity tends to move or flow in its active
state.
– Electricity is a good representing data in motion.
– Magnetism is good at representing data at rest.
• Both have two separate and opposing states,
and allows for Base 2 digital communication.
• The movement of digital data is easily
represented by the two states of electricity or
magnetism and is conveniently presented by
1 or 0 respectively.
Building Blocks: The Origins of Data
• Bit – A single zero (0) or a single one (1).
Smallest unit of data recognized or processed
by a computer.
• Binary is the basic building blocks of a
communication system for silicon-based
technologies. (Computers, Mobile phone,
etc..)
Bit
• With a single bit, we are limited to only two
choices 1(yes or on) or 0 (no or off). By adding
another bit (two bits), you double the possible
outcomes. (00,01, 10, 11)
Growing the Building Blocks of Data
• As you connect consecutive 0’s and 1’s (Bits)
together, the ability to represents an increasingly
larger set of characters, and words increases
geometrically.
• Example:
– 1 Bit  0 or 1
– 2 Bits  00, 01, 10, 11
– 3 Bits  000, 001, 010, 011, 100, 101, 110, 111
Power of Zero
What is 2 to the power of 0?
First let’s study the law of exponents
n^x/n^y = n^(x – y)
Example:
2^4/2^2 = 2^(4-2) = 2^2 = 4
Power of Zero  First we need to establish that a number divided by itself is 1.
Examples:
3/3 = 1, 5/5 = 1, 125/125 = 1
Then we can say the following:
1 = 2^4/2^4 = 2^(4-4) = 2^0
Why is this important? It allows us to understand the geometric growth of possible
states or outcomes attained by combining bits.
Power of 2
American Standard Code For
Information Interchange
• History of ASCII: (Wikipedia definition)
Abbreviated from American Standard Code for Information
Interchange, is a character-encoding scheme. Originally based on the
English alphabet, it encodes 27 = 128 specified characters into 7-bit
binary integers as shown by the ASCII chart on the right. The characters
encoded are numbers 0 to 9, lowercase letters a to z, uppercase letters
A to Z, basic punctuation symbols, control codes that originated with
Teletype machines, and a space. For example, lowercase j would
become binary 1101010 and decimal 106.
ASCII codes represent text in computers, communications equipment,
and other devices that use text. Most modern character-encoding
schemes are based on ASCII, though they support many additional
characters.
BYTE
• English-language personal computers used in America
employ a seven bit character code called ASCII, which
allows for a character set of 128 items of upper- and
lower – case Latin letters, Arabic numerals, signs, and
control characters. ASCII also serve as a foundation of
the Universal Character Set (UCS).
• The eighth bit is used as a parity bit, with its value used
for checking whether or not data have been
transmitted properly.
• Eight bits equal one byte which gives us a character
code of 256.
ASCII
Character Codes: The Basis for
Processing Textual Data
• Textual data is also numerical data to a computer.
• The circuitry of the microprocessor that lies at the heart of
a modern computer system can only do two things:
1.
2.
•
Calculate Binary Arithmetic operations
Perform Boolean (true or false) logic operations
A character code pairs a character set, such as an
alphabet, with a decimal and/or binary system.
Character Code
• The max characters possible in a character
code depends upon numbering system and
number of bits.
• More bits in the character code, the bigger the
character set.
• Computer operates more efficiently when
processing data in bytes. Most common is 8,
16, 32, 64 bits. Using a 10 bit or 15 bit or
other non multiple of 8 character code is
inefficient to handle in a computer.
Extended ACII and Unicode
• Extended ASCII is an eight-bit encoding
scheme that includes the standard seven-bit
ASCII characters as well as other.
• Unicode – is a character coding system
designed to support the world wide
interchange, processing, and display of the
written texts of the diverse languages.
• Unicode – 16 bit coding scheme will allow for
65,536 potential outcomes which allow us to
cover most of all the world’s languages.