0% found this document useful (0 votes)
29 views11 pages

(English (Auto-Generated) ) Representing Numbers and Letters With Binary - Crash Course Computer Science #4 (DownSub - Com)

The document discusses how computers represent and store numerical data using binary numbers. It explains that binary uses the digits 1 and 0 to represent values, working in base-2 rather than base-10 decimal. Larger numbers are represented by adding more binary digits in increasing places values. Common number representations like 8-bit, 32-bit, and 64-bit formats are explained in terms of the range of values they can store and how signed and floating point numbers are handled. The document also covers how computers represent text using character encoding standards like ASCII.

Uploaded by

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

(English (Auto-Generated) ) Representing Numbers and Letters With Binary - Crash Course Computer Science #4 (DownSub - Com)

The document discusses how computers represent and store numerical data using binary numbers. It explains that binary uses the digits 1 and 0 to represent values, working in base-2 rather than base-10 decimal. Larger numbers are represented by adding more binary digits in increasing places values. Common number representations like 8-bit, 32-bit, and 64-bit formats are explained in terms of the range of values they can store and how signed and floating point numbers are handled. The document also covers how computers represent text using character encoding standards like ASCII.

Uploaded by

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

hi i'm carrie ann this is crash course

computer science and today we're going

to talk about how computers store and

represent numerical data which means

we've got to talk about math but don't

worry every single one of you already

knows exactly what you need to know to

follow along so last episode we talked

about how transistors can be used to

build logic gates which can evaluate

boolean statements and in boolean

algebra there are only two binary values

true and false but if we only have two

values how in the world do we represent

information beyond just these two values

that's where the math comes in

[Music]

so as we mentioned last episode a single

binary value can be used to represent a

number instead of true and false we can

call these two states one and zero which

is actually incredibly useful and if we

want to represent larger things we just

need to add more binary digits this

works exactly the same way as the

decimal numbers that we're all familiar

with with decimal numbers there are only

10 possible values a single digit can be

0 through 9. and to get numbers larger

than 9 we just start adding more digits


to the front we could do the same with

binary for example let's take the number

263

what does this number actually represent

well it means we've got two 100s six

tens and three ones if you add those all

together we've got 263. notice how each

column has a different multiplier in

this case it's 100 10 and 1. each

multiplier is 10 times larger than the

one to the right that's because each

column has 10 possible digits to work

with 0 through 9. after which you have

to carry one to the next column for this

reason it's called base 10 notation also

called decimal since deci means 10. and

binary works exactly the same way it's

just base two that's because there are

only two possible digits in binary one

and zero this means that each multiplier

has to be two times larger than the

column to its right instead of hundreds

tens and ones we now have fours twos and

ones take for example the binary number

one zero one this means we have one four

zero twos and one one add those all

together and we've got the number five

in base ten but to represent larger

numbers binary needs a lot more digits


take this number in binary we can

convert it to decimal in the same way we

have 1 times 128 0 times 64 1 times 32 1

times 16 0 times 8 one times four one

times two and one times one which all

adds up to a hundred and eighty three

math with binary numbers isn't hard

either take for example decimal addition

of 183 plus nineteen first we add three

plus nine as twelve so we put two as the

sum and carry one to the tens column now

we add eight plus one plus the one we

carried that's ten so the sum is zero

carry one finally we add one plus the

one we carried which equals two so the

total sum is two hundred and two here's

the same sum but in binary just as

before we start with the ones column

adding 1 plus 1 results in 2 even in

binary but there's no symbol 2 so we use

1 0 and put 0 as our sum and carry the

1. just like in our decimal example 1

plus 1 plus the one carried equals three

or one one in binary so we put the sum

as one and carry one again and so on we

end up with this number which is the

same as the number two hundred and two

in base ten each of these binary digits

one or zero is called a bit so in these

last few examples we were using 8-bit


numbers with their lowest value of 0 and

highest value of 255 which requires all

8 bits to be set to 1 that's 256

different values or 2 to the 8th power

you might have heard of 8-bit computers

or 8-bit graphics or audio these were

computers that did most of their

operations in chunks of 8 bits but 256

different values isn't a lot to work

with so it meant things like 8-bit games

were limited to just 256 different

colors for their graphics and 8 bits is

such a common size in computing it has a

special word a byte a byte is 8 bits if

you've got 10 bytes it means you've

really got 80 bits you've heard of

kilobytes megabytes gigabytes and so on

these prefixes donate different scales

of data just like one kilogram is a

thousand grams one kilobyte is a

thousand bytes or really eight thousand

bits mega is a million bytes and giga is

a billion bytes today you might even

have a hard drive that has one terabyte

of storage that's eight trillion ones

and zeros but hold on that's not always

true in binary a kilobyte has two to the

power of ten bytes or a thousand and

twenty four a thousand is also right


when talking about kilobytes but we

should acknowledge it isn't the only

correct definition you've probably also

heard the term 32-bit or 64-bit

computers you're almost certainly using

one right now what this means is that

they operate in chunks of 32 or 64 bits

that's a lot of bits the largest number

you can represent with 32 bits is just

under 4.3 billion which is 32 ones in

binary this is why our instagram photos

are so smooth and pretty they are

composed of millions of colors because

computers today use 32-bit color

graphics of course not everything is a

positive number like my bank account in

college so we need a way to represent

positive and negative numbers most

computers use the first bit for the sign

one for negative zero for positive

numbers and then use the remaining 31

bits for the number itself that gives us

a range of roughly plus or minus 2

billion while this is a pretty big range

of numbers it's not enough for many

tasks there are 7 billion people on the

earth and the us national debt is almost

20 trillion dollars after all this is

why 64-bit numbers are useful the

largest value a 64-bit number can


represent is around 9.2 quintillion

that's a lot of possible numbers and

will hopefully stay above the us

national debt for a while most

importantly as we'll discuss in a later

episode computers must label locations

in their memory known as addresses in

order to store and retrieve values as

computer memory has grown to gigabytes

and terabytes that's trillions of bytes

it was necessary to have 64-bit memory

addresses as well in addition to

negative and positive numbers computers

must deal with numbers that are not

whole numbers like 12.7 and 3.14 or

maybe even stardate

43989.1 these are called floating point

numbers because the decimal point can

float around in the middle of a number

several methods have been developed to

represent floating point numbers the

most common of which is the ieee 754

standard and you thought historians were

the only people bad at naming things in

essence this standard stores decimal

values sort of like scientific notation

for example

625.9 can be written as 0.6259

times 10 to the power of 3. there are


two important numbers here the point

6259 is called the significant and 3 is

the exponent in a 32-bit floating point

number the first bit is used for the

sign of the number positive or negative

the next eight bits are used to store

the exponent and the remaining 23 bits

are used to store the significant okay

we've talked a lot about numbers but

your name is probably composed of

letters so it's really useful for

computers to also have a way to

represent text however rather than have

a special form of storage for letters

computers simply use numbers to

represent letters the most

straightforward approach might be to

simply number the letters of the

alphabet a being 1 b being 2 c three and

so on in fact francis bacon the famous

english writer used five bit sequences

to encode all 26 letters of the english

alphabet to send secret messages back in

the 1600s and 5 bits can store 32

possible values so that's enough for the

26 letters but not enough for

punctuation digits and upper and

lowercase letters enter ascii the

american standard code for information

interchange invented in 1963 ascii was a


7-bit code enough to store 128 different

values with this expanded range it could

encode capital letters lowercase letters

digits 0 through 9 and symbols like the

at sign and punctuation marks for

example a lowercase a is represented by

the number 97 while a capital a is 65 a

colon is 58 and a closed parenthesis is

41. ascii even had a selection of

special command codes such as a newline

character to tell the computer where to

wrap a line to the next row in older

computer systems the line of text would

literally continue off the edge of the

screen if you didn't include a new line

character because ascii was such an

early standard it became widely used and

critically allowed different computers

built by different companies to exchange

data this ability to universally

exchange information is called

interoperability however it did have a

major limitation it was really only

designed for english fortunately there

are eight bits in a byte not seven and

it soon became popular to use codes 128

through 255 previously unused for

national characters in the us those

extra numbers were largely used to


encode additional symbols like

mathematical notation graphical elements

and common accentuated characters on the

other hand while the latin characters

were used universally russian computers

use the extra codes to encode cyrillic

characters and greek computers greek

letters and so on and national character

codes work pretty well for most

countries the problem was if you opened

an email written in latvian on a turkish

computer the result was completely

incomprehensible and things totally

broke with the rise of computing in asia

as languages like chinese and japanese

have thousands of characters there was

no way to encode all those characters in

eight bits in response each country

invented multibyte encoding schemes all

of which were mutually incompatible the

japanese were so familiar with this

encoding problem that they even had a

special name for it moji bokeh which

means scrambled text and so it was born

unicode one format to rule them all

devised in 1992 to finally do away with

all of the different international

schemes it replaced them with one

universal encoding scheme the most

common version of unicode uses 16 bits


with space for over a million codes

enough for every single character from

every language ever used more than 120

000 of them in over 100 types of script

plus space for mathematical symbols and

even graphical characters like emoji and

in the same way that ascii defines a

scheme for encoding letters as binary

numbers other file formats like mp3s or

gifs use binary numbers to encode sounds

or colors of a pixel in our photos

movies and music most importantly under

the hood it all comes down to long

sequences of bits text messages this

youtube video every webpage on the

internet and even your computer's

operating system are nothing but long

sequences of ones and zeros so next week

we'll start talking about how your

computer starts manipulating those

binary sequences for our first true

taste of computation thanks for watching

see you next week

crash course computer science is

produced in association with pbs digital

studios at their channel you can check

out a playlist of shows like physics

girl deep look and pbs space time this

episode was filmed at the chatham stacey


evergold studio in indianapolis indiana

and it was made with the help of all

these nice people and our wonderful

graphics team thought cafe that's where

we're going to have to halt and catch

fire see you next week

[Music]

You might also like