hi I'm Kerry Ann and welcome to crash
course computer science this 1960 pdp-1
is a great example of early computing
with graphics you can see a cabinet size
computer on the left and
electromechanical teletype machine in
the middle and a round screen on the
right note how they're separated that's
because text-based tasks and graphical
tasks were often distinct back then in
fact these early computer screens had a
very hard time rendering crisp text
whereas typed paper offered much higher
contrast and resolution
the most typical use for early computer
screens was to keep track of a programs
operation like values in registers it
didn't make sense to have a teletype
machine print this on paper over and
over and over again that would waste a
lot of paper and it was slow on the
other hand screens were dynamic and
quick to update perfect for temporary
values computer screens were rarely
considered for program output though
instead any results from a computation
were typically written to paper or some
other more permanent medium the screens
are so darn useful that by the early
1960s people started to use them for
awesome things
[Music]
a lot of different display technologies
have been created over the decades but
the most influential and also the
earliest with cathode ray tubes or CRTs
these work by shooting electrons alpha
emitter at a phosphor coated screen when
electrons hit the coating it glows for a
fraction of a second
because the electrons are charged
particles their paths can be manipulated
with electromagnetic fields plates or
coils are used inside to steer electrons
to a desired position both left right
and up down with this control there are
two ways you control graphics the first
option is to direct the electron beam to
trace out shapes this is called vector
scanning because the glow persists for a
little bit if you repeat the path
quickly enough you create a solid image
the other option is to repeatedly follow
a fixed path scanning line by line from
top left to bottom right and looping
over and over again you only turn on the
electron beam certain points to create
graphics this is called raster scanning
with this approach you can display
shapes and even text all made of little
line segments eventually as display
technologies improved it was possible to
render crisp dots onto the screen also
known as pixels the liquid crystal
displays or LCDs that we use today are
quite a different technology but they
use raster scanning to updating the
brightness of little tiny red green and
blue pixels many times a second
interestingly most early computers
didn't use pixels not because they can
physically but because it consumed way
too much memory for computers at the
time a 200 by 200 pixel image contains
40,000 pixels
even if you use just one bit of data for
each pixel that's black or white not
grayscale the image would consume 40,000
bits of memory that would have gobbled
up more than half of a PDP ones entire
ram so computer scientists and engineers
had to come up with clever tricks to
render graphics until memory sizes
caught up to our pixel issues ambitions
instead of storing tens of thousands of
pixels early computers stored a much
smaller grid of letters most typically
80 by 25 characters there's 2,000
characters in total and if each is
encoded in 8 bits using something like
ASCII it was consumed 16,000 bits of
memory for an entire screen front of
text which is way more reasonable taller
self computers needed an extra piece of
hardware that could read characters out
of RAM and convert them into raster
graphics to meter onto the screen this
was called a character generator and
they were basically the first graphics
cards inside they had a little piece of
read-only memory a ROM those stored
graphics for each character called a dot
matrix pattern if the graphics card saw
the 8-bit codes to the letter K then it
would raster scan its 2d patterns onto
the screen in the appropriate position
to do this the character generator had
special access to a portion of the
computer's memory reserved for graphics
a region called the screen buffer
computer programs wishing to render text
to the screen simply manipulated the
value stored in this region just as they
could with any other data in map this
scheme required much less memory but it
also meant the only scene could draw as
text even still people got pretty
inventive of ASCII art people also tried
to make rudimentary pseudo graphical
interfaces out of this basic set of
characters using things like underscores
and plus signs to create boxes lines and
other primitive shapes but the character
set was really too small to do anything
terribly sophisticated so various
extensions to ask you were made added
new semi graphical characters like IBM
CP 4 3 7 character set seen here which
was used in DOS on some systems the text
color and background color could be
defined with a few extra bits that
allows glorious interfaces like this DOS
example which is built-in timing out the
character setting you just saw character
generators were a clever way to save
memory but they didn't provide any way
to draw arbitrary shapes and that's
important if you want to draw content
like electrical circuits architectural
plans maps and well pretty much
everything there isn't text to do this
without resorting to memory boggling
pixels computer science issues the
vector mode available and CRTs the idea
is pretty straightforward all content to
be drawn on screen is defined by a
series of lines there's no text if you
need to draw text you have to draw it
out of lines don't read between the
lines here there is only lines got it
all right no more wordplay I'm drawing
the line here let's pretend this video
is a Cartesian plane
200 units wide and 100 tool would be
origin that's the zero zero point in the
upper left corner we can draw a shape
with the following vector commands which
we've borrowed from the vector X an
early vector display system first we
reset which clears the screen moves the
drawing point of the electron gun to
zero zero and sets the brightness of
lines to zero then we move the drawing
point down to
50/50 and set the line intensity to 100%
with the intensity up now we can move to
150 then 60 75 and then back to 50/50
the last thing to do to set our line
intensity back to 0% cool we've got a
triangle this sequence of commands would
consume about 160 bits which is way more
efficient than keeping a huge matrix of
pixel values just like how characters
were stored in memory and turned into
graphics by a character generator these
vector instructions were also stored in
memory and rendered to a screen using a
vector graphics card hundreds of
commands could be packed together
sequentially in the screen buffer and
used to build up complex graphics all
made of lines because all these vectors
are stored in memory computer programs
can update the values freely allowing
for graphics that change over time
animation one of the very earliest video
game space wall was built on a PvP won
in 1962 using vector graphics is
credited with inspiring many later games
like asteroids and even the first
commercial arcade video game computer
space 1962 was also a huge milestone
because of sketchpad an interactive
graphical interface that offered
computer aided design called CAD
software today it's widely considered
the earliest example of a complete
graphical application and its inventor
Ireland Sutherland later won the Turing
Award for this breakthrough to interact
with graphics sketchpad used a recently
invented input device called a light pin
which was a stylus tethered to a
computer with a wire by using a light
sensor in the tip the pen detected the
refresh of the computer monitor using
the timing of the refresh the computer
could actually figure out the Pens
position on the screen with this light
pen and various buttons on a gigantic
computer users could draw lines and
other simple shapes sketchpad could do
things like make lines perfectly
parallel the same length straightened
corners into perfect 90-degree
intersections and even scale shapes up
and down dynamically these things that
will have Boreas on paper a computer now
did with a press of a button users were
also able to save complex designs they
created and then paste them into later
designs and even share with other people
you could have whole libraries of shapes
like electronic components and pieces of
furniture you could just plop in and
manipulate in your creation this might
all sound pretty routine from today's
perspective but in 1962 when computers
were still cabinet size behemoths
chugging through punchcards sketchpad
and light pens where equal parts i
opening and brain-melting they
represented a key turning point in how
computers could be used they were no
longer just number crunching math
machines that hummed along behind closed
doors now they were potential assistants
interactively augmenting human tasks the
earliest computers and displays with
true pixel graphics emerge in the late
1960s bits in memory directly mapped to
pixels on the screen what were called
bitmap displays with full pixel control
totally arbitrary graphics were possible
you can think of a screens graphics is a
huge matrix of pixel values as before
computers reserved a special region of
memory for pixel data called the frame
buffer in the early days the computers
RAM was used but later systems use
special high-speed video RAM or via RAM
which was located on the graphics card
itself for high-speed access this is how
it's done today on an 8-bit grayscale
screen we can set values from zero
intensity which is black to 255
intensity which is why well actually you
might be green or orange as many only
displays couldn't do white let's pretend
this video is a really low resolution
bitmap screen with a resolution of 60 by
35 pixels if we wanted to set the pixel
at 10 10 to be white we could do it with
a piece of code like this if we wanted
to draw a line let's say from 30 0 to 30
35 we can use a loop like so and this
changes a whole line of pixels to whites
if we want to draw something more
complicated let's say a rectangle we
need to know 4 values the x and y
coordinates of its starting corner and
its width and height
so far we've drawn everything in white
so let's specify this rectangle to be
grey grey is halfway between 0 and 255
so that's a color value of 127 then with
two loops one nested in the other so
that the inner loop runs once for every
iteration of the alpha loop we can draw
a rectangle when the computer executes
our codes as part of its draw routine it
colors in all the pixels we specified
let's wrap this up into a draw a
rectangle function like this now to draw
a second rectangle on the other side of
the screen maybe in black this time we
could just call our rectangle drawing
function voila
just like the other graphic schemes
we've discussed programs can manipulate
pixel data in the frame buffer creating
interactive graphics pong time of course
programmers aren't wasting time right
drawing functions from scratch they use
graphic libraries we're ready to go
functions for drawing lines curve shapes
text and other cool stuff just a new
level of abstraction the flexibility of
bitmap graphics opened up a whole new
world of possibilities for interactive
computing but it remained expensive for
decades as I mentioned last episode by
his latest 1971 it was estimated there
were around 70,000 electromechanical
teletype machines and 70,000 terminals
and use in the United States amazingly
there are only around 1,000 computers in
the u.s. that had interactive graphical
screams that's not a lot but the stage
was set helped along by pioneering
efforts like sketchpad and space Wars
for computers and space become
ubiquitous and with them the dawn of
graphical user interfaces which we'll
cover in a few episodes I'll see you
next week
crash course computer science is
produced in association with PBS Digital
Studios
at their channel you can check out our
playlist of shows like gross science
ATF reactions and the art assignment
this episode was filmed at the chad and
stacey emigholz studio in indianapolis
indiana and it was made with the help of
all these nice people and a wonderful
graphics team thought cafe thanks for
watching
and Tritonia off and then back on again
[Music]
you