0% found this document useful (0 votes)
393 views34 pages

Doujin CPU Chan

The CPU, or central processing unit, is the brain of the computer that processes instructions and data. It can process any type of information, not just numbers, as early computers were limited to. The CPU runs programs and controls all functions and components of the computer by executing stored instructions. It communicates with other parts of the computer via circuits to carry out tasks.

Uploaded by

murah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
393 views34 pages

Doujin CPU Chan

The CPU, or central processing unit, is the brain of the computer that processes instructions and data. It can process any type of information, not just numbers, as early computers were limited to. The CPU runs programs and controls all functions and components of the computer by executing stored instructions. It communicates with other parts of the computer via circuits to carry out tasks.

Uploaded by

murah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

1

What Does the CPU Do?

Ayumi
Bang!

Bang!

* A Japanese board game similar to chess


Wow,
Ayumi...
Phew!

Clack
Strong as
ever, I see.

Hmm, twenty wins


in a row...
And it’s all thanks
to you, Ayumi!
Marry meeee!
Good job!

le
Ratt

Hug! I’m a good


I bet our booth will sport, but that
be the most popular might be a bit
much...
one at the festival!

That’s my girl! Now wear


this for the next game!

Cr Take a
pu ow break already.
ll d
er You’re ridiculous.

Well, you’re ... Ayu mi


unbeatable whether
I’m here cheering
or not.

See you
around!

Unbeatable,
huh?
She’s right!
I am strong!
Or actually,
everyone else
is so weak it’s
boring me to Knock
tears.... knock

Excuse me.

Oh, sure!

Do you...
have time
for a game?
I’d love to!

I see...
well then...
FUHAHAHAHAHAHA!
Behold! Unleashed from
The Chasm of darkness!

k
un
Th

The Shooting Star!!

What’s he so
excited about?!
It’s just a black
computer!!

What? It’s
just a shogi
board...?

Indeed...

I’d actually like you


Just my luck...
to play against my
a real weirdo.
computer, not me.
Heh...
Er, you want me,
It’s not just a
a real shogi player,
computer game.
to play your
video game?

I’m a
busy person,
you know...

h
This laptop, the Cras
Shooting Star, is

y
r
running a program

Fu
of my own design.

Welll... I don’t really


get what you’re saying,
but it’s obvious you’re
looking down on me.

Crac
k
ble
R um

And...
it’s stronger I just have to win, right?
I hope you’re ready to
than you! be destroyed...
I lost...?

How is that possible??

No way!
stands no chance
against my
Shooting Star!

Is this some kind


of prank?

Even the
national champion
Ayumi Katsuragi...

Be swallowed in
its dark depths and
taste utter defeat!
FUHAHAHAHAHAHAHAHAHA!
I... I can’t
believe it...

I lost to
someone Like what?
like this...?

I can’t believe someone as intelligent


A wonderful
and wonderful as me could lose to
person indeed...
someone as weird and lame as you!!

Oh, but wait


a sec. So I didn’t
really lose!

It’s not like I


lost to you. You coward!
I just played a How about you fight
computer game. me yourself instead!

8 Chapter 1  What Does the CPU Do?


Ayumi Katsuragi!
Know when you
are beaten!

It’s true that it


wasn’t me who
beat you.

But that also means


your intellect was
no match for the CPU,
the Shooting Star’s
intellect!

And that’s a fact!

it also means
that yours truly,
Yuu Kano, the genius huh?
programmer who
brought that CPU to
life, possesses an
equal—

CPU?
No! An even
more impressive
intellect!

  9
But why would you
Isn’t a CPU Like this? say that the CPU is
some kind of your computer’s
computer chip? intellect?

What does
a CPU do
anyway?

Heh, that would If you don’t hurry up and


take some time tell me, this shooting star
to explain. might come crashing down
at any minute!

Only meteorites
crash to earth!

But if you insist,


Such
you could convince
barbarism!!
me, the Yuu Kano, by
asking really nicely.

Even if I did tell I already asked.


you, it would take Just get on
quite some time... with it! Don’t wave
are you sure you’re it around
up for this? like that!

Leave the computer


alone first!

10 Chapter 1  What Does the CPU Do?


Computers Can Process Any
Type of Information
Well then. First off, the
word computer comes
from the word compute.
Let’s take
our time and
start from the The first computers
beginning. were just computing
machines, like modern
calculators.

E-even I can do math!


It’s true that humans
I’ll have you know
can do math too...
I’m really good at
mental arithmetic!

9 times 9
is 81! But We
can all agree it’s
much more practical
Whoa, take to do large
it easy! calculations on
calculators, right?

Ngh... yeah...
Yup, but modern
so computers...
computers are...

Hmm...

are really good at


doing calculations much more
really fast. than just
calculators!
All kinds of information is
being digitized now. Things
like music, photographs, and
video can be represented
using just 1s and 0s.

When we translate any type


of data into digital form
(that is, represent it with
1s and 0s), it becomes a lot
easier to process using
a computer.

Oh, I’ve heard of that before.


Like digital TV and
digital cameras,
right?

Only 1s and 0s!

I guess that means


computers in general
live in the digital world,
where only 1s and 0s
are allowed...

Well, digitizing
But what’s information made a
so great lot of new things
about that? possible.

Digital technology
is really important
to many aspects of
modern life.

12 Chapter 1  What Does the CPU Do?


Oh!

So you mean all of


these things are
thanks to digital
technology?

Editing photos taken


Surfing the web, with my digital camera
looking at news and on my computer and
videos... emailing them...

g and il
Editin Ema
g!
essin
proc
Transfer!

l
Digita
ra
ca me

Buying digital music and


transferring it to my
MP3 player!

That’s right! All


these things use
digital technology.

And, at the core of all There’s that word


this technology, the CPU again! So what does
is acting as the brain. the CPU actually do?

Computers Can Process Any Type of Information  13


The CPU Is the Core of Each Computer

which means that


the CPU...

CPU is short for Central


Processing Unit. is in charge of the
computer’s operations!

what are
Whaaaaaaaat! Operations?!! operations?

Operations It’s also worth mentioning


are computer that CPUs perform two kinds
calculations, of operations.

calculations using
only 1s and 0s.

14 Chapter 1  What Does the CPU Do?


The Operations of the CPU*

Arithmetic Operations Logic Operations

The only arithmetic


Logic operations deal with
operations that computers
comparing pairs of 1s or 0s in a
can perform are addition
few simple ways.
and subtraction.

Plus Not
Min us Or
And

Wait a second...
don’t jump to
conclusions.

Hah! All it can


do is simple
calculations?
I don’t know
why I was
ever worried!
* In addition to these operational units, modern CPUs also contain FPUs (Floating Point Units)
that can handle multiplication and division. But this book just sticks to the basics.

Here
comes the You need more
important components than
part! just the CPU!

For a computer What?!


to work... There’s more??

The CPU Is the Core of Each Computer  15


With a Santa that
Of course! If Santa
worthless, I’d put shogi
Claus gave you a CPU
pieces in his mouth and
for Christmas after
punch both cheeks.
promising you a
computer...

Fi
st
You have a pretty
Wouldn’t you be a twisted mind, do
little confused? you know that?

The Five Components


of a Modern Computer Control
unit
Here’s a quick
overview of the most
important parts of a
computer. Arithmetic
unit

Input Memory Output


device system device

Control flow Primary memory

Data flow Secondary memory

Let’s call these the The computer’s five primary systems


computer’s five primary
systems. As you can see, the
CPU contains both the control Data is exchanged through
unit and the arithmetic unit. the input/output system.

Uh, that’s a lot of


stuff... seems kind
of difficult...
I’ll go through
the five systems
one by one, so
don’t worry.

16 Chapter 1  What Does the CPU Do?


Output devices, on the
First off, input devices other hand, are systems
are systems for that translate internal
supplying the computer data into an external
with instructions and representation.
input data.
Monitors and printers
are good examples of
home computer output
devices.

The keyboard
and mouse for
your home
computer are
great examples.

I guess it’s true that I Furthermore, we talked


input information using about the arithmetic unit
my keyboard and access before, which is the system
that performs operations
information by looking at
(or calculations).
my monitor.

The name is
kind of self-
explanatory.

The memory
But here comes an
system?
extremely important The control
point! unit?

For the arithmetic unit


to work, it needs to
cooperate with both
the memory system and what do they do?
the control unit.

The Five Components of a Modern Computer  17


First off, the memory
system is responsible
for storing and Memory comes
retrieving data. in two flavors:
primary memory and
secondary memory.

When learning about


the CPU, we’re mainly
concerned with
primary memory.

Primary memory
ry,” It looks
When we say “memo
we generally mean like this.
primary memory.

It’s because when the CPU


Memory... why is that
performs operations, it
so important?
always needs to operate on
some type of information
stored in memory.

Operate on
memory?

18 Chapter 1  What Does the CPU Do?


Yes, both the data
that’s operated on and
the computer program
are stored in memory.
Control
Operations use these
unit
as input.

Arithmetic
unit

input data

output data

Depending on Program
the operation, data may (instructions)
be retrieved from memory
for input, or the result Primary
of the operation may be Memory
returned back into memory
for storage.*
* The CPU may use either registers or cache memory.

Retrieving and returning... To put it simply...


The CPU really exchanges
information!

By the way, Programs are


I’ve heard that word instructions that
program before, people give the
but what is it? computer.

Instructions about
what data to use, and
which operations I see. Programs
to run and in what are directions that
order. tell the computer
what to do.
Please do
it like th is.
Okay!

Program
(instructions) Computer
Human
All those
instructions
are written in
programs.

The Five Components of a Modern Computer  19


There’s one system
we haven’t talked
ls everyth about yet!
ntro ing
Co

Control unit

tion
r uc
Inst

Input Output
Arithmetic
Memory
unit

The control unit


tells the other four
systems what to do! It
gives out instructions
and controls the
computer.

That seems pretty arrogant!


So it’s like some kind of Yeah, that’s right. Also, like
overseer that gives out I said before, programs
orders left and right? are stored in memory.

on
The control unit cti Get data from
g ra
m
n stru over there!
reads the program Pro from I
d
instructions from rea mory
me
memory and interprets Then add these two!
them.

And then save that sum


over there!

It gives orders to all


the other systems, telling
them how to process the
program’s instructions.

20 Chapter 1  What Does the CPU Do?


Oh, I see! So the Exactly. Now we’ve
control unit is gone over all
necessary because it five systems, but...
makes sure that...

Memory

Arith-
metic
n- Unit
Co ol
tr it
Un
t Input
Outpu

the program’s
instructions are
processed!

To understand
Yeah! Now I know what
how the CPU
all the things in the
works, data and
diagram are!
instruction flow
seem really
important...

And the arrows


between them illustrate
data exchange and
instruction flow, Hmm
right?

FUHAHAHAHA!
It pleases me
Wow, he’s all kinds
that you are
of energetic...
grasping the
basics!!

HA HA
HA HA
HA
HA

HA

Well then!
Let us move
on to the He must really
next topic!! like CPUs.

The Five Components of a Modern Computer  21


ALUs: The CPU’s Core
ALUs? Not CPUs?
You’re catching What’s the difference?
on pretty quickly,
it seems.

So let’s talk a bit


about ALUs.

Well, ALUs are what


perform operations
inside the CPU. Control Unit

Arithmetic Unit
(ALU)

ALUs are the


arithmetic unit’s
principal components.

Oh! That seems like Yes, ALU is short for


it’s super important! Arithmetic Logic Unit.

It performs the
arithmetic and logic
operations we talked
about before.
22 Chapter 1  What Does the CPU Do?
And this is what ALUs
look like.

Input A Input B

F S
Command Status
input/ output
opcode

Y
Output

Uh... Why is it shaped


like a bowl or a V simple! It has the two inputs, A
or whatever? and B, which it combines
using an operation...

to produce some
output Y.

Oh, I see. So if we wanted to,


for example, calculate 5 - 3 = 2,
we would have 5 and 3 as inputs
and get a 2 as output, right?
Subtraction

Exactly!

ALUs: The CPU’s Core  23


Input Input
So the command input
F is what we want the
ALU to do...

F S
Command Status
input/ output
opcode

Output

like addition or
subtraction, for example.

And the status output


S tells us how the Command
operation went. input Positive
Subtraction value

Status
output

This could be
information on So in the case of 5 – 3 = 2,
since the result of the
whether our output
calculation is 2, the status
value was positive or output should say it’s a
negative, for example. positive value, right?

But why does anyone That’s a good question. As


need to know whether a matter of fact, the status
the output was positive output can be used to make
decisions based on whether
or negative?
the output satisfies some
given condition.

Decisions?
Conditions?

24 Chapter 1  What Does the CPU Do?


CPUs Process Operations and Make Decisions

Let’s use a
concrete
example. I use ATMs
sometimes.
Let’s assume that this
computer controls an ATM.

Cash Deposit

Account Account
History balance

Account
statement

When withdrawing cash, Oh! I see


the computer has to check what you
the customer’s account mean.
balance as well.

Let’s say the 5 – 3 in this So that’s why the


case means, “An account status output is
balance of $500 minus a so useful!
withdrawal of $300.”

CPUs Process Operations and Make Decisions  25


Because what happens after But if the result is
the subtraction is done will be negative, that means you
completely different depending tried to withdraw more
on whether the result was money than what was
positive or negative. available...

So depressing...

If the result is positive, that And you’ll get a message


means you have enough money saying that you have an
in your account, so the ATM will insufficient balance so you
give the money to you. can’t withdraw that amount.

The operation result was positive. The operation result was negative.

Please Insufficie
take nt
your m ba la nce
oney.

Ack...

That’s it! In other words,


the status output will tell
you if you have enough
money in your account to
make a withdrawal.

The CPU will make a decision


based on whether the
result of the subtraction
was positive or negative
and change its behavior
accordingly.

26 Chapter 1  What Does the CPU Do?


That’s how the CPU is able
to process operations as Decis
n ion
well as make decisions! r atio
Op e

Okay! So if you give Yes, computers are able to


perform certain tasks faster
the CPU a program,
than humans, process amounts
it will be able to of information far too great
process instructions for humans to comprehend,
and make decisions. and surpass humans in many
different skills.

Heh
heh
heh

And by repeating that


process, computers are Like shogi,
able to perform all kinds for example...
of tasks, right? no offense...

I see! I feel like I


Oh?
understand the CPU
a bit better now.

Hmm, but I bet


there’s a lot I still
don’t know.

CPUs Process Operations and Make Decisions  27


No, I was super
I gotta study more! frustrated! I’m probably
so mad I won’t be able to
sleep tonight!!!

a a !
Ug a

Of course, I was a
little frustrated that
I lost at shogi...

But I see the CPU


Well, I have to admit I find
that beat me as
it pretty fun to explain
my rival!
computers to other
people...

And I want to learn


everything I can about
my new rival!

I... I mean, I suppose I find Oh, I see! I think


it amusing to educate the I finally get
why you’re so
ignorant masses from
enthusiastic about
time to time. FUHAHAHAHAHA! explaining this
to me!

...?

28 Chapter 1  What Does the CPU Do?


You don’t have any
friends, right?
Are you
I’m right, aren’t I? pitying me?!

You’re just happy to finally have


someone to talk to, right? I
understand that it’s fun to hole
up and write programs all by
your lonesome, but it’s important
to talk to people, too...

It’s okay—this is a Or I should say...


great opportunity If you don’t,
for you! Teach me you aren’t getting
about CPUs! this back...

Heh ehe...

Don’t take it
hostage!!

I’ll take that as a yes!


Let’s get studying!

Hey! Don’t put


words in my mouth!!
I’ve got a life too!
What Is Information Anyway?

Information technology (IT) became an everyday phrase back in the 20th century. The
term is frequently heard when people talk about the internet and other computer tech-
nology, but it’s worth noting that this term predates the use of computers.
First off, what does the word information actually mean?To put it simply, information
is everything in our environment that can be registered with any of our five senses.

Everything that I can perceive is information!

five Nature
The es
s
se n

h ,
touc
ring,
n, h ea d smell
Visio , a n
taste
News
Art

Everything that occurs in nature or in paintings, photographs, music, novels, news,


radio, TV broadcasts, and so on is an example of information. Most of these things have
been around for a lot longer than our society has had access to electricity. As information
spreads throughout society, it affects our lives.
Every day, people and organizations value useful information while trying to filter
out everything else. Information that is not important is called noise, and important
information is called signal. Finding ways to maximize the signal-to-noise ratio—that is,
the amount of signal in an output compared to the amount of noise—without accidentally
losing necessary information is important.
One type of information that historically has been important both to people and
organizations is information about food—what’s safe or healthy to eat, how to find or
grow it, and how far away it is or how much it costs to buy. Related information, such as
climate and weather forecasts, is also vital. Obviously, information like this was valued
long before the rise of the internet. For example, merchants like Bunzaemon Kinokuniya
from Japan’s Edo period specialized in products such as citrus and salmon and thrived
because they valued this type of information. Indeed, the value of information has been
respected for as long as people have needed to eat.
However, the digital age has affected many aspects of life. How has it affected our
access to information? Well, thanks to the digitization of data, we are now able to process
diverse data like text, audio, images, and video using the same methods. It can all be
transmitted the same way (over the internet, for example) and stored in the same media
(on hard drives, for example).

30 Chapter 1  What Does the CPU Do?


Different types
of information
The Exchanging data!
internet
Storage!

In the past,
different media
were used computer Another device
for each.

Computers that are connected to the same network can exchange digitized informa-
tion. By using computers to match and analyze large sets of data instead of analyzing
each instance or type of data individually, people can discover otherwise hidden trends or
implications of the information.
Like the storage of data, information transmission has made incredible advances,
thanks to important discoveries in electronics and electrical engineering. Commercial
applications of this technology in devices such as telephones, radio, and television have
played a role in accelerating this development. Today, almost all of Japan enjoys digital
television, which uses digital transmission and compression technologies. CPUs play a
central part in these applications by performing countless operations and coordinating
the transfer of information.

The Difference Between Analog and Digital Information

We have been talking about digitizing data into 1s and 0s so that information can be
processed by a CPU. But before they are digitized, text, audio, video, and so on exist as
analog data.
What is the difference between these two types of data? An example that illustrates
the difference is thermometers. Analog thermometers contain a liquid that expands as
it heats up, such as mercury or alcohol, in a gradated capillary tube that is marked with
lines indicating the temperature. To determine the temperature, we look at the level of
the liquid in the tube and compare it to the markings on the tube. We say that the analog
thermometer has a continuous output because the temperature reading can fall any-
where between the marks on the tube.
Digital thermometers use a sensor to convert temperature into voltage* and then
estimate the corresponding temperature. Because the temperature is represented numeri-
cally, the temperature changes in steps (that is, the values “jump”). For instance, if the
initial temperature reading is 21.8 degrees Celsius and then the temperature increases,
the next possible reading is 21.9 degrees Celsius. Because 0.1 is the smallest quantity
that can be shown by this thermometer, changes in temperature can only be represented
in steps of 0.1 and the value could never be between 21.8 and 21.9 degrees. Thus, digital
output is said to be discrete.

*  Voltage is a way of measuring electric currents and is expressed in volts.

The Difference Between Analog and Digital Information  31


Analog Digital

A discrete value is expressed in


Even small changes are visible.
a certain number of digits.

Attention!
Beep!

I see...

After 21.8°C comes


Hmm, it’s
21.9°C. There are no
a bit less
values in between.
than 22°C,
I think...

The word digital comes from the act of counting off numbers using our fingers—or
digits. This tends to lead people to believe that digital computers can only work with data
comprised of integers (whole numbers), which is not necessarily true.
In the digital world, everything is expressed in 1s and 0s. Indeed, they are not
even what the CPU works with. Note that these are not actually numbers in this context.
Instead, a 1 and a 0 are merely symbols. The CPU consists of transistors that transmit or
inhibit electrical signals and consequently output either low or high voltages. It is these
voltages that we represent as 1 or 0. A high voltage is represented with a 1, since the
transistor’s state is “on,” and a low voltage, or an “off” transistor, is represented with a 0.
In text, you could illustrate this by using the symbols  and . The 1s and 0s are called
primitives, meaning they are basic data types. Computers can work with decimal numbers
as long as the value has a finite number of digits. Values such as these are also digital.
The important thing to remember is that for any digital number, you can never add or
remove a quantity smaller than the smallest possible value expressible.
Let’s compare some analog data and its digitized version to better understand how
they are alike and how they differ by looking at the figure on the next page. The first pair
of images shows audio data, and the second pair shows image data.
As you can see, every time we translate analog data into digital data, some informa-
tion is lost. But as you’ve undoubtedly experienced, most modern digitization processes
are so good that humans can’t tell the difference between the original and the digital
copy, even when they are presented side by side.
To store and transmit digital data of a quality such that our senses can’t detect any
loss of information, we use special compression techniques. These techniques always
involve trade-offs among how much space is used, how much information is lost during
compression, and how much processing time is needed to compress and decompress
the data.

32 Chapter 1  What Does the CPU Do?


Audio Waveform

Analog Data Digital Data

Graphic or Video

Analog Data Digital Data

When color information is translated into digital form, it is split into
three base component colors, most often red, green, and blue (known
as RGB). These colors are combined to create a composite color on a
screen. Each component color can be represented by a number, with
larger numbers indicating there’s more of that color.

When heavily compressing audio or video data, we often use lossy techniques that
change and simplify the data in such a way that we usually do not notice a difference.
While this approach saves a lot of space, as the name implies, reconstructing the original
data perfectly is impossible since vital information is missing. Other techniques—most
notably all text compression techniques—use lossless compression, which guarantees that
the original data can be completely reconstructed.
In any case, with the appropriate arithmetic and logic operations, as long as the data
is digital, a CPU can use any compression technique on any form of information. Although
digitizing data can involve the loss of some information, a major advantage of digital data
over analog data is that it allows us to control noise when transmitting the data.

As long as the information is


made up of 1s and 0s, I’ll keep
applying operations!

The Difference Between Analog and Digital Information  33

You might also like