thanks to brilliant dot-org for
sponsoring this video I recently took
delivery of a new laptop to edit videos
on the go and I'm a pretty smart guy I
mean admittedly I did lose my
girlfriend's car in a car park for an
hour last week but I've got a couple of
degrees in science I know the rules of
how the universe works but if you ask me
or pretty much anyone I think to explain
how this works what's going on inside
I'd be able to tell you a little bit
about how there's memory the computer
remembers stuff and there's a processor
that does things with those bits of
information in the memory but at some
point my explanation is just going to
boil down to magic happens inside the
box but this isn't exactly satisfactory
to me I want to be able to understand
how the magic box works you know how it
does something like multiply two numbers
together well recently I was in
Manchester and I got to spend some time
with a really special really old
computer called the baby and with baby
you can literally see the inside of the
computer's memory what you're looking at
is the computer manipulating individual
bits of information based on a program
that's encoded in machine language in
the memory right in front of your eyes
let's maybe back up a bit though let's
say we want to understand how a magic
box multiplies two numbers together in
order to do this we need to understand
three things firstly how computers store
numbers secondly how computers know what
actions to carry out and how computers
execute a program in this video I'm
going to introduce all of these concepts
and refer to baby as a really
interesting historical example and then
at the end I'll link you to further
information if you're still interested
in this endeavor I'm going to be
assisted by Tim one of the fantastic
volunteers and by Sarah the curator of
engineering at the Manchester Museum of
Science and Industry and there's a
reason why we're bringing up baby in
this video the computer behind me is a
replica of a machine that was built at
Manchester University in 1948 by
professors Freddie Williams and Tom
Kelvin
it's claim to fame is it's the world's
first all-electronic computer with an
electronic memory there's very little
surviving of the original we've got a
few valves this replica is the closest
you can get to that to let historic
computing
sorry so let's address the first
question how do computers store and
handle numbers when we write a number
say six thousand one hundred and seventy
four we use base 10 that is to say that
we have ten symbols which we write in
columns that represent increasingly
large numbers each column represents the
successive power of ten in fact and a
number is the sum of these columns
multiplied by the values in those
columns a computer however writes
numbers in binary or base two
this is because it's electronically
easier and more reliable to tell the
difference between two things rather
than ten things this means that there
are just two symbols 0 & 1 which are
written in columns representing
increasingly large numbers but each
column now represents a successive power
of 2 the number 6170 4 is then written
as 1 1 0 0 0 0 0 0 1 1 1 1 0 it's an
example of a 13 bit number that's
because it took 13 ones and zeros to
represent it simple early home computers
had just 8-bit memory meaning that the
largest individual number that they
could imagine was 1 1 1 1 1 1 1 1 or 255
in decimal baby
unusually has 32-bit memory meaning that
the largest number it can imagine is
whereas s30 ones or 4 billion 294
million nine hundred sixty seven
thousand 295 and you can see this 32-bit
capability on the baby monitor which is
actually the memory of the computer
we'll get to that in just a second on
each line there are 32 dots referred to
as a 32-bit word if a dot is small then
it's a 0 well if it's big then it's a 1
so this line for example is the binary
number 1 1 0 1 1 10 zeros 1 16 zeros or
3 billion 623 million nine hundred
forty-four thousand 192 at least it
would be normally baby unusually has the
least
Perkin digits on the left rather than
the right so this numbers actually 30
2795 so that's how a computer imagines a
number but I've been using that word in
quotation marks this entire time so how
does a computer actually remember
actually think of a number well in
modern computers this is done in hard
drives and solid state drives note by
the way that there's a difference
between hard drives and SSDs otherwise
known as storage and memory storage is
where a computer remembers stuff in the
long run memory is where it remembers
stuff that it's currently using if you
imagine data as being like books then
storage is like library shelving while
memory is like the reading table in the
library they both contain the same
things but the reading table only
contains the books that a person or a
computer user is reading or using at
that time the larger the memory the more
pieces of information that the computer
can use at once or the larger the
reading table this laptop has 16
gigabytes of 64-bit memory meaning that
it can in theory store a maximum of 4.3
billion
64-bit words now baby on the other hand
can store a maximum of 32 32-bit words
meaning that it has a total memory of
1,024 bits or 128 bytes and that today
is the equivalent of a text message from
your phone I said before that this
screen is the actual memory of the
computer and I meant that because while
modern computers store information as
charge in a circuit
either in transistors or in a capacitor
baby uses a special cathode ray tube
known as a Williams tube to hold
information in its memory while also
displaying it to humans the Williams
tube was the first ever digital random
access memory or RAM device you might
recognize cathode ray tubes as the
technology that used to power old TVs
the chips produce a visible glow by
pelting a surface covered in a phosphor
with electrons a side effect of doing
this is that if the electrons are pelted
at a screen with enough energy electron
are knocked out of the screen leaving a
small area of positive charge for a
brief period of time if electron beams
are directed at a number of locations on
the screen then you have several
distinct areas where the charge can be
positive or neutral for some short time
a thin conducting sheet placed in front
of the screen then reads these changes
in charge as a voltage so that's how
baby remembers information remembers
numbers as dark and bright spots on this
screen read as voltages by its
electronics and you can see there are 32
words of 32 bits each in its memory but
the memory isn't just used for data a
computer needs to know what operation we
want it to do in our case multiply two
numbers together and if you look at
baby's main display you can see that the
memory is split into two above this
solid line of dots things are unchanging
and constant while below it the value in
the memory keeps changing
that's because above the line the memory
is being used to remember a program a
program is just a series of instructions
at these two numbers together save to
this file print this message to screen
etc if you've seen my videos before then
you've seen me programming with varying
degrees of success in a few languages
such as Python but programming as we
humans do it needs to be translated by
the computer before a machine like baby
can understand our instructions this is
a huge and very complicated topic which
I'm not going to go into detail about
here if you are interested I'd recommend
this video in particular from ben eaters
excellent channel on electronic computer
science for this video suffice to say
that when we talk about programming it
looks very different to the actual
instructions that go on inside a
computer and that while I'm talking
about how baby does it other computers
do it differently
baby remembers individual instructions
in its memory using 16 bits of
information for each instruction in
those 16 bits seen on the display here
there are two crucial pieces of
information bits 1 to 13 are used to
specify an address in the memory and
bits 14 to 16 are used to specify an
action so in programming the computer
done by this series of switches here
which incidentally are leftover parts
from Spitfire planes seriously you write
out a set of instructions that you want
the computer to follow one after the
other given seven possible actions these
actions are built into the electronic
architecture of the computer if bits 14
to 16 on the current line being read
from the memory contain 1 1 1 for
example then the conditional parts of
the computer circuitry are activated
which stop the program running this
magic is accomplished through vowels or
vacuum tubes which make the whole
operation of enacting different actions
conditional actions possible this is
called a thermionic valve or to North
American viewers a vacuum tube and this
device is used to control the flow of an
electric signal as it passes through the
computer in this computer allows you to
turn the election the electron flow on
and off which would represent maybe
switching something from the binary ones
providing 0 in this computer there are
500 valves of different types either
these this type or these very little
small ones that you can see here so
that's how computers know and remember
what we want them to do we enter actions
which are defined and limited by the
electronic architecture of the computer
along with an address where in the
memory we want an action to take place
and the computer enacts those
instructions one after the other this
then leaves us with a final question how
does a computer actually enact a program
and say calculate the multiplication of
two numbers to go through the
electronics of baby and answer that
question fully would be way too
complicated and above the level of this
video especially seeing as the circuit
diagram of baby looks like this so at
this point I'm gonna get a little bit
more hand wavy for the sake of brevity
once the switch to begin a program has
been flipped the computer begins at the
top line in the memory reading it into
the processor this consists of two parts
firstly the line is read and separated
into an instruction and an address these
are then read by the electronics and
acted on the second part of the
processor is the accumulator which if
you like is the active
part of the memory it's a word of
32-bits
which instructions can reference for
example the instruction code zero zero
one subtracts the number at a specified
memory address from the value in the
accumulator and then stores the results
in the accumulator so for example this
line tells the computer to take whatever
value is stored on the xxx line and
subtract it from the value stored in the
accumulator once this is done the
computer then proceeds onto the next
line taking about one thousandth of a
second the computer does this proceeding
from one line to the next until a 1 1 1
or stop instruction is reached and when
this happens the program is finished if
you wanted to write a program
multiplying two numbers together as
we've been discussing then this zero
zero one function would let you do that
because while there's no instruction
that explicitly says multiply these two
numbers together multiplication of a and
B is just adding B to itself a times so
if we write a loop of this function
telling the computer to keep subtracting
a number B from a value in the
accumulator until a condition is met
that the action has taken place a times
then we've accomplished what we've set
out to achieve
I leave the writing of a program that
can multiply to 32-bit numbers together
as an exercise for the viewer along with
links to the technical details of baby
in the description leave your attempts
in the comments because this is a very
fortuitous time to get involved with
baby this summer on the 21st of June
it's the 70th anniversary of the the
first time the baby come free to run its
run it's stored program so we'll be
celebrating the 70th anniversary of the
original baby computer and also it's the
20th anniversary of our replicas so it's
it's a really big year for us this video
has hopefully at least somewhat
demystified the magic of what happens
inside these metal boxes and we've
covered how computers remember numbers
how computers know what we want them to
do and how computers actually carry out
calculations but if you've been left
wanting more than as I've already said
been eater has a fantastic channel on
the nuts and bolts of electronic
computing crash course also have a
course on computer science
and the msi itself has much more
information about baby and its
historical significance on their website
but if you'd like to understand more
about how modern computers memory works
and there is literally nowhere better to
start than the course on it on brilliant
org brilliant offer expertly written
courses on topics such as computer
memory machine learning and computer
science algorithms that are tackled by
students professionals and science
enthusiasts literally all over the world
and just as I encouraged you to get
stuck in and tackle writing a problem
using babies instructions brilliant
emphasizes learning about this stuff by
trying problems getting stuff wrong and
learning from your mistakes exactly how
you should be learning scientific
content to clarify a bit of confusion
you can use bits of brilliant for free
and I absolutely encourage you to do so
but you can also get a premium account
which gives you access to the curated
courses for example amongst other
features and if you like the sound of
that and you also like the sound of a
discount then make sure you use the link
in the description that's brilliant dorg
forward slash Simon Clark to get 20% off
your subscription and support this
channel thank you so much to the
wonderful people at the MSI for allowing
me to make this video I really can't
recommend the museum enough it's
fantastic particularly if you've got
kids with you and if you'd like to see
baby then you can visit it at the museum
and you can also have a chats and these
fantastic volunteers there the lovely
people they know their stuff and they
are more than happy to talk to you about
baby at any level of computing knowledge
and of course thank you so much for
watching the video I hope you enjoyed
this one it's a slightly different
format from what I've done before I
really just enjoy trying to put across
these broad topics an introduction to a
whole new thing with a historical slant
on it so let me know what you thought in
the comments and also remember to
comment with your baby code I've left
information down there in the
description just underneath the like
button family enough about how to write
that code so comment with your thoughts
comment with your codes and thank you
again for watching I see in the next one
[Music]
you
[Music]