3 - Lecture 3 [ID:45452]
50 von 723 angezeigt

Okay, shall we start and maybe we can get through the material today so that we can

start programming next week. Who remembers this? Who remembers this? Yeah? How to represent

numbers and how to count them with them in binary. Yeah, so binaries should be something

that you can convert more or less in your head. At least, I mean, I would say three or four

positions you should be able to recognize by just seeing them because they can be quite effective

in programming hardware. Who can explain this excess eight notation? What happens here? Anybody?

No wrong answers, okay? Just try. It gets an extra negative integer number. Sorry again? It has an

extra integer number onto the right. Like minus eight is the extra number that's on there. Okay,

so extra number is a good point. We need to find something. It is actually minus seven to seven,

but extra eight is included. Okay, but what do we do with the eight? So we have identified eight

is probably the largest number we can represent with four digits, with four binary digits. What

do we do with the eight if we use excess notation? It's like, yeah, how do you move?

How do you move mathematically? Yeah, well, subtraction or addition. Yes, what's your answer?

You can add another bit or it's only with four bits.

So you can add, subtract, yes, excess basically means shift and shift in this sense means

be subtracted, right? So that every signed notation now is shifted so that the

zero, the smallest bit pattern, yeah, so that the smallest bit pattern represents the smallest

decimal number. It just makes sorting easier. It's not as intuitive anymore because zero doesn't mean

zero anymore, but we can sort them out quite easily because the larger the binary numbers,

no matter if signed or not unsigned, the larger the decimal representation for it. Okay, so keep

that in mind. That's probably, it sounds awkward, but we come to this in just a moment.

Yeah, so I just see that there's just two one positive or is that just a mistake or

what like in the excess state? Yeah, you have minus one, it's minus one.

It's minus one and it's just like a mistake or yes, yeah, right, is the way it's supposed to be.

Okay, very, very spotless. Yes, right. Okay, so yes, that should be minus one.

It's just a table, right? Okay, no, yeah, that was my question. Yeah, yeah, yeah, no, no, so,

but this is also an interesting point here. We have one additional number we can represent minus

eight and that only goes to seven. Yeah. And the other representations, we have things like plus

zero and minus zero. This is not very nice, but no, no, here in excess notation, two's complement

first, then excess notation. So in this notation, we only have a single bit pattern for a single

number. So that representation is unique. It's not a surjection or something like that. It's a kind

of unique projection on the numbers, but yes, minus one. Okay, so keep that in mind. We are going to

floating points now because that's the only thing we haven't discussed yet,

in number representation. And then we only need to do one thing.

And that's interesting now.

And then we only need to briefly talk about the very basics of memory. Then we're done. And then

you know how a computer works. Okay, floating point numbers. So why do we need floating point

numbers? Well, you know, we have vast amount of different value ranges, but as you saw before,

in the number representation session, we are very limited in what we can actually represent with

bit patterns. And if it would go all the way up to, I don't know, world population or how long a

light here is, or solar mass is, I don't even know what that number, how to call that number, right?

It's a, what do we have here? Kilo, mega, giga, tera, beta, jota, and there are no names actually

anymore beyond that. So if you want to represent something like this, or the diameter of an

electron is very, very small, the range of the actual, of the real world is enormous.

And it's probably more with patterns than we have available. And there are also, when you know how

math works, there are some numbers which cannot be represented accurately, like pi or a lot of

real fractions, right? So cannot represent all of these numbers. So we need some tricks to work,

to represent this in ones and zeros. We still only have ones and zeros. How could we do this? Well,

we can estimate how many bits we would actually need for any sort of number to represent that

range. And we can use this usually with using logarithms. So if I want to know how many bits

Zugänglich über

Offener Zugang

Dauer

01:25:29 Min

Aufnahmedatum

2022-10-31

Hochgeladen am

2022-10-31 18:36:05

Sprache

en-US

floating point representation, memory organisation

Tags

Python programming
Einbetten
Wordpress FAU Plugin
iFrame
Teilen