Тёмный

Binary Coded Decimal (BCD) & Douglas Adams' 42 - Computerphile 

Computerphile
Подписаться 2,4 млн
Просмотров 123 тыс.
50% 1

Just how do you go from a binary number to a printed out numeric character? Professor Brailsford takes us through Binary Coded Decimal
IBM, EBCDIC & a Meg-in-a-box: • IBM, EBCDIC & A Meg-In...
Atari 2600 VCS Programming: • Atari 2600 VCS Program...
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Опубликовано:

 

29 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 260   
@profdaveb6384
@profdaveb6384 6 лет назад
Yes, I just wanted to show that "Computerphile" presenters other than Dr Bagley are also allowed to wear Hawaiian shirts! This particular one was bought about 8 years ago at Macy's, in Stanford University's Shopping Mall.
@Roanokekidstech
@Roanokekidstech 6 лет назад
It’s a nice looking shirt! I have quite a few Hawaiians myself. I have always had a passion for electronics and computers and I have learned a lot through your videos on Computerphile. I love Microcomputers and home brew cpu’s and computer builds I am going to be studying computer engineering at the University of Cincinnati next year. I hope that one day I will be able to go to the UK to check out the centre of computing history and maybe sneak into one of your classes at Nottingham. Thanks for all you have done.
@profdaveb6384
@profdaveb6384 6 лет назад
Best wishes for your computer engineering studies. I'm pleased that our "Computerphile" videos helped you on the way.
@OrganDanai
@OrganDanai 6 лет назад
I hope you don't mind me saying this, professor Dave B, but your likeliness to professor Donald Ervin Knuth is quite uncanny. I wonder if he joined your stroll through Stanford University's mall. 😄
@11Kralle
@11Kralle 6 лет назад
...and I learned the meaning of a new word! to nibble - knabbern :D
@devdonedidit
@devdonedidit 4 года назад
Prof. Brailsford, please only wear Hawaiian shirts from now on. I thought you were cool before but now you've proven how much cooler you are!
@TheTwick
@TheTwick 6 лет назад
Professor Brailsford, NEVER STOP telling us stories about computers and computing. I could listen all day.
@typograf62
@typograf62 6 лет назад
I could not. But it seems that I cannot resist listening all night.
@ZX48K
@ZX48K 6 лет назад
The ASCII equivalent of 42 is asterisk. The asterisk is used in computing to represent 'anything'. So the answer to life, the universe and everything is anything ;)
@tibfulv
@tibfulv 6 лет назад
+Klapaucius Fitzpatrick Yep, that's how writing works, lol.
@tibfulv
@tibfulv 6 лет назад
SQL uses both, actually. Asterisk is used in SELECT statements and means all matching records, % and _ with the LIKE operator. _ works like DOS ?, and matches a single character. % works like DOS *, and matches zero to all following characters.
@ZX48K
@ZX48K 6 лет назад
Thank you! As a developer for a number of years. I've had difficulty multiplying numbers.
@tibfulv
@tibfulv 6 лет назад
Well, now you know. :D
@BenjaminGoldberg1
@BenjaminGoldberg1 6 лет назад
In regular expressions, the asterisk is used to me "zero or more of whatever happened previously". Since an asterisk at the beginning of a regex is nonsense, we must conclude that there was a supercomputer previous to Deep Thought which computed part of the answer, which Deep Though is saying must be repeated indefinitely. In summary, the meaning of life is that it is something which goes on, and on, and on.
@vylbird8014
@vylbird8014 6 лет назад
The exact wording is important. The Deep Thought was specifically asked "What is the answer to the ultimate question of life, the universe and everything?" The answer it eventually gave was 42. It was not, however, able to compute the ultimate question itsself, to which 42 was the answer.
@chucku00
@chucku00 5 лет назад
And the Earth was created by mice to compute the ultimate question.
@frankowalker4662
@frankowalker4662 4 года назад
@@chucku00 They only LOOKED like mice in this dimension.
@virior
@virior 4 года назад
Of course it was not able, there was a spatial detour to be constructed.
@ezwa29
@ezwa29 6 лет назад
42 in binary is (mentioned in the video) 101010. When Parliament of the Czech Republic (where I am from) agreed a law on digital broadcasting or digital phoning or whatever digital (I can't remember), they made it valid since 10. October 2010, or 10.10.10. They I believe proved their sense of humor...
@b0bjedump
@b0bjedump 6 лет назад
Why weren't my teachers more like this guy?! Hats off to the knowledge and experience.
@RMoribayashi
@RMoribayashi 6 лет назад
HP scientific calculators all used BCD so avoided the rounding problems inherent in a true binary calculator. In 2004 Thomas Okken's released his exellent HP-42 simulator, Free42. It comes in both BCD and the slightly faster floating point binary versions. SwissMicros brought it full circle in 2017 when they released the DM-42, a physical calculator based on the HP-42 but using a modified version of Free42 for it's firmware. And yes... it uses BCD.
@senddrews8225
@senddrews8225 6 лет назад
re: rounding problems inherent in a true binary calculator. Should be rounding problems inherent in a floating point calculator.
@Zadster
@Zadster 6 лет назад
Top choice of shirt Prof. B! Every time I see one of these videos, I get nostalgic for when I was an undergrad, and a wee bit jealous of all those people about to go to university to learn all sorts of amazing new things. Good times!
@grantnichol4496
@grantnichol4496 6 лет назад
The double dabble algorithm is a pretty great way to convert beateeen binary and BDF. It's how you can output to an lcd screen at the end of an arythmatic unit.
@Xilefian
@Xilefian 6 лет назад
I was programming some stuff with binary coded decimal the other day. It's still used for real-time clock chips! If you want the bare-metal low level time from these chips they give you BCD, presumably because it's easier to print BCD out to cheap digital displays than to convert an integer to a string. EDIT: Yep you mentioned digital clocks at the end of the video! Very excellent.
@DrewNorthup
@DrewNorthup 6 лет назад
That, and as it has been the standard since "the beginning of time" there's really no reason to change. (Yes, many do provide a non-BCD interface. I'd not be overly surprised to find one using the 64-bit UNIX epoch.)
@Grant2464
@Grant2464 6 лет назад
Cool
@eideticex
@eideticex 6 лет назад
mwalsher. asm and nasm are standard GNU toolset. I worked with it on a modern computer to write a rudimentary OS just to learn how OSes work at the lowest level. Had a mix of C compiled to assembly and raw assembly to do a handoff for memory management purposes using PC memory management instructions. Pretty much anywhere I wanted to access the underlying machine from C, I had to write a two part C and assembly pair of functions to create a binding to the instruction and inject repeated setup stuff like stuffing args into registers and memory locations. It's great what you can do with a modern computer. My rudimentary OS is complex enough that it could handle a program and exposed an OpenGL 3.3 binding that had to be watched careful because keeping those alive without drivers is a real challenge. Originally I was going to try making a game on it but the binding management is so heavy that modern OSes with drivers handle so much better it's crazy.
@Jimbaloidatron
@Jimbaloidatron 6 лет назад
Xilefian - A 'fun' something I discovered with PC CMOS RTC when investigating Y2K was that at least one design had a flaw for leap years, very relevant to all this. If you've got a value in pure binary, you can easily check if it is divisible by four by checking for zero in the least significant two bits, but this won't work for BCD. That fact didn't stop them trying! So consider the year 1992 (the century part 19, is just stored elsewhere as a static value not part of the clock), so we have just 92, in BCD, the least bits are not zero, so the defective chips did not have a leap year in 92, but for 94 and 98 they did! So if you have a vintage PC that gets the date wrong at the end of February, this is the little known about reason! Thankfully Y2K itself was a leap year because it was divisible by 400 and so an exception to the 100 year rule.
@chucku00
@chucku00 5 лет назад
@Gerben van Straaten Hours : Duodecimal (or Tetravigesimal on a 24 hours basis) Minutes : Sexagesimal
@nikolaradakovic5050
@nikolaradakovic5050 2 года назад
You Sir Dave bring internet to a very different level of usefulness . Thank you for such a high quality yet free content.
@cyndicorinne
@cyndicorinne Год назад
What a beautiful explanation and historical context of BCD.
@rejidomus3013
@rejidomus3013 6 лет назад
These stories are pure gold.
@tabaks
@tabaks 6 лет назад
An episode on FUNDAMENTAL differences between AI and classical programming would be GRAND! Basically, for the lay person, why AI isn't just a giga-complex classical programming effort that is pre-loaded with all possible outcomes...
@nathansmith3608
@nathansmith3608 5 лет назад
in ML/AI, code you write sets up stats models which process input data for patterns to determine a response, instead of programming its behavior directly. you don't pre-load all outcomes, but models are flexible
@typograf62
@typograf62 6 лет назад
DAA - decimal adjust accumulator. An instruction on the Z80. Fixes decimals overflowing into hexadecimal.
@NuntiusLegis
@NuntiusLegis Год назад
SED - SEt to Decimal. An instruction on the 65xx. Makes it's math instructions operate on BCD values.
@philrod1
@philrod1 6 лет назад
8-bit arcade machines use BCD for displaying scores, etc. on the screen. The Z80 CPU has the DAA instruction for _fixing_ BCD values after ADD, SUB, etc.
@tonycolle8699
@tonycolle8699 6 лет назад
I love these journeys into history. It's actually very important to have some knowledge of these topics so people who want to be Computer Scientists and not just programmers (although there is nothing wrong with the profession) know how we got to where we are and where we might be heading in the future. Is there some chance that Professor Brailsford or someone can do a session on packed decimal? That is the technology on which so much of the financial world was built and still lives today.
@sudoLife
@sudoLife 2 года назад
Every video of yours is like a journey through the time and brains of engineers & scientists!
@amprocha1
@amprocha1 6 лет назад
Thank you sir. I always appreciate your brilliant way to express your vast knowledge.
@agstechnicalsupport
@agstechnicalsupport 4 года назад
Great video on the importance and use of Binary Coded Decimal (BCD). Thank you !
@rjones6219
@rjones6219 Год назад
Some 40 years ago, I used to work on a computer that worked in BCD (not IBM). You typed in a decimal digit, it processed it in decimal, and then output the result in decimal.
@rogeriorogerio1007
@rogeriorogerio1007 6 лет назад
Very entertaining piece of history from the professor
@andrewharrison8436
@andrewharrison8436 3 года назад
One more step from BCD is "packed decimal" where each byte is split into 2 BCD nibbles - then you have the fun of dealing with signs as well. As for converting binary to/from text or BCD - yes done that, got the scars. Real performance hit on a VAX. Accountants really didn't like floating point and rounding. Actuaries much more relaxed, the end result of an Actuarial calc always needs rounding so go for the better performance of floating point for compound interest and mortality rate calcs.
@Slithy
@Slithy 6 лет назад
"Heavyweight macho calculations". I love it.
@Anvilshock
@Anvilshock 6 лет назад
Wonderful conclusion!
@superscatboy
@superscatboy 6 лет назад
When I was young and naive, I wanted to work with huge integers in QBasic (to calculate large Lucas numbers) and inadvertently reinvented a highly inefficient BCD system. It was ugly and slow, but it worked goddammit. Still one of my proudest moments in a strange way. I still have a printout of a 20000 digit Lucas number I generated with that nasty bit of work.
@proloycodes
@proloycodes 2 года назад
oh wow! great acheivement!
@JCCyC
@JCCyC Год назад
Now here is a fun fact: The BASIC interpreter in most of the 8-bit computers of the 70s and 80s use binary for their floating-point representation, but some (like the MSX and the Tandy 100 series) use BCD.
@confusedwolf7157
@confusedwolf7157 6 лет назад
whoa!! excellent sunny shirt!!
@Smelter57
@Smelter57 5 лет назад
We used BDC to give a stock code to a blank PCB when we could only use drilled holes. Using two drill sizes, and, as a "magic" marker of a pair of vertical holes, to write 42 it would look like : .o.. oo.o
@sarabhian2270
@sarabhian2270 3 года назад
I was looking to create 10bit bin2bcd convertor and this man really solved my issue😭👍👍👍🙌🙌🙌🙌.
@johnfrancisdoe1563
@johnfrancisdoe1563 6 лет назад
Your quote of the dialogue was incomplete. The sentence uttered by deep thought before the answer was slightly longer. But the recipients of the output didn't know what the question was, so they commissioned the building of planet Earth to compute the corresponding question.
@MCPhssthpok
@MCPhssthpok 6 лет назад
Yes, this is so often misquoted. They wanted the answer to the *ultimate question* of life, the universe and everything.
@CJBurkey
@CJBurkey 6 лет назад
Thank you
@mgrinzRafal
@mgrinzRafal 6 лет назад
BCD seems to be so common that you don't really think about it on a daily basis. Great to see there is a story behind it :)
@abhijitborah
@abhijitborah 6 лет назад
Not from computing profession, but learn a lot here just by listening.
@obvious_humor
@obvious_humor 6 лет назад
The Ultimate Answer is 42. The Ultimate Question is "What do you get when you multiply nine by six?"
@therm0tt0
@therm0tt0 5 лет назад
And you would think that something is fundamentally wrong with the universe, but the calculation actually works in base 13!
@GilesBathgate
@GilesBathgate 6 лет назад
If only they had continued and made 4bits = nibble, 8bits = byte, 16bit= munch, 32bit = gobble, 64bit = meal.
@RaymondHng
@RaymondHng 6 лет назад
So Windows XP is a gobble-based operating system. And Windows 7 is a meal-based operating system.
@GilesBathgate
@GilesBathgate 6 лет назад
RaymondHng Sure if you like. But we never called 8-bit operating systems 'byte-based' in that context.
@RaymondHng
@RaymondHng 6 лет назад
And what about 36 bits? 72 bits?
@GilesBathgate
@GilesBathgate 6 лет назад
36bit = Mushrooms and 72bit = Peyote 😂
@bryede
@bryede 5 лет назад
128bit = buffet?
@NeilRoy
@NeilRoy 6 лет назад
Clicks LIKE before the video starts because Brailsford... respect your elders, they have a lot they can teach you.
@OlafDoschke
@OlafDoschke 6 лет назад
Did I already mention this in another video? Motorola's 68000 CPU had the assembler instruction ABCD - Add Binary Coded Decimal.
@JamienM
@JamienM 3 года назад
This spawned the double dabble. Wish I watched this last semester
@menachemsalomon
@menachemsalomon 6 лет назад
How efficient is multiplication with BCD? I ask because the Intel x86 line allows for BCD addition and subtraction, with "adjustments" and a flag to handle the overflow into the 0xA-0xF space. But for multiplication and division, the operands have to be converted to binary first, and the result back into BCD afterwards. (The FPU can load and store BCD, but internally arithmetic is done in binary.) Is it just the manual method performed in hardware?
@unvergebeneid
@unvergebeneid 6 лет назад
Would've loved to see more on actual arithmetic in BCD. How much of a performance hit does it take when done in hardware? How much more complicated do the circuits become?
@allanrichardson1468
@allanrichardson1468 4 года назад
Most early high speed scientific computers stored entire numeric (binary) words of data or an entire instruction in each addressable unit of memory (IBM 700 and 7000 series with 36-bit words, for example), so a single arithmetic operation required six memory cycles: fetch the first instruction, load the first operand into the accumulator, fetch the second instruction, add/subtract/whatever the second operand against the accumulator, fetch the third instruction, and store the accumulator in the desired memory word. These machines had the fastest arithmetic-logic units of the era, and wide parallel logic circuits that required the minimum number of CPU cycles per memory cycles to get the job done. But commercial computers, like the IBM-1401, generally had variable word length arithmetic and stored each character in its own memory location. Arithmetic and text operations were done with each character from one area of memory matched against its corresponding character in another, replacing one of them with the result. Their logic and memory cycles were also longer, making them much slower in raw computing power than the big number crunchers. But they were more than fast enough to keep up with high speed card and print devices and tape decks. Extra processing power to compute an invoice, payroll, or grade point average would be wasted if the data files could not be read or written fast enough. I once used the entire 132 character as an accumulator in a Fibonacci series program on a 1401, and even the 100+ digit to 100+ digit addition didn’t slow down the high speed printer (one line in 100 ms)! Only when the System-360 architecture, allowing a mix of binary and decimal (BCD) operations and memory accesses, was introduced, was a single machine practical that could do both kinds of processing efficiently.
@boriscat1999
@boriscat1999 6 лет назад
IEEE 754-2008 standardized a decimal floating point format, which is related to BCD. Many programming languages (Java, C#) support decimal floats as well, but often they have to do pure software emulation as much of the mainstream hardware is limited to only the older binary floating point format from an earlier IEEE 754 standard, with all of its weird rounding issues.
@pcuser80
@pcuser80 6 лет назад
The Z80 had a special instruction for convert the A register to BCD. DAA (Decimal Adjust accumulator)
@ConsciousAtoms
@ConsciousAtoms 6 лет назад
x86 has similar instructions. I recently coded FizzBuzz directly in assembly and used exactly this to represent the counter.
@user-qf6yt3id3w
@user-qf6yt3id3w 6 лет назад
Not any more it doesn't - long mode/x64 - reuses those opcodes for something else.
@ConsciousAtoms
@ConsciousAtoms 6 лет назад
I did not know that, thanks for the addition. Although to be entirely correct, modern 64 bit CPUs still have these instructions, but only when running in any mode other than long mode.
@MrCyanGaming
@MrCyanGaming 6 лет назад
BCD makes multi-digit 7 segment displays easier :D
@jeffirwin7862
@jeffirwin7862 6 лет назад
Do modern hand calculators use BCD? What about digital clocks on things like desktop computers and smartphones?
@RamLaska
@RamLaska 4 года назад
I had NO idea that the ascii digit characters corresponded to BCD in their least significant nybble! That’s so cool!!!!
@gamereditor59ner22
@gamereditor59ner22 6 лет назад
Interesting!😎 Saving the video in the computer and network file.
@unvergebeneid
@unvergebeneid 6 лет назад
Decimal floating point next?
@johnfrancisdoe1563
@johnfrancisdoe1563 6 лет назад
Penny Lane Ti-99/4A had decimal base100 floating point.
@nanopi
@nanopi 6 лет назад
IEEE754: 0.1 + 0.2
@allanrichardson1468
@allanrichardson1468 4 года назад
The IBM-1620 had BCD integer instructions, but to save logic circuits, they used a table in the first few hundred digit pairs to get the answers. The FORTRAN and other language compilers used library subroutines to implement decimal floating point.
@DreanPetruza
@DreanPetruza 2 года назад
wow, what happened at 7:20? Ok, it's a simple matrix transform, but it looks so cool
@c0d3w4rri0r
@c0d3w4rri0r 3 года назад
What about Excess-3? Isn’t that the more common way to do bcd in low level hardware like calculators?
@schifoso
@schifoso 6 лет назад
Some microprocessors had rudimentary BCD opcodes, such as the Intel X86.
@misterhat5823
@misterhat5823 6 лет назад
Why not use an integer number of cents to represent money? Then there's no problem with incorrect rounding.
@gordonrichardson2972
@gordonrichardson2972 6 лет назад
Mister Hat The fixed decimal format is used in several circumstances, to represent both cents and percentages.
@risvegliato
@risvegliato 6 лет назад
because some things, like small parts like nuts and bolts for example, cost less than a penny.
@KuraIthys
@KuraIthys 6 лет назад
Yes, I ran into that at some point. I was looking at zero ohm surface mount resistors on an electronics website... (why would you want a zero ohm resistor? Well, obviously it's a jumper. It lets you build a single circuit board then bridge relevant traces to create various different options without needing an entirely new circuit board design.) And the way they're priced is... Interesting. I believe thanks to volume pricing it was roughly the same price to buy 5000 of the things as it was to buy 10? Can't remember the exact rates, but, yeah, cheap doesn't begin to cover it. XD Actually, looking it up.... A single unit is 13.8 cents. Already you see a fraction of a cent involved. But... Volume pricing at 1000 units is 1.9 cents At 10,000 it's 0.6 cents and at 50,000 it's 0.4 cents So in all cases you're dealing in 10ths of a cent. But also consider that the volume price is 1/34.5 of the unit price. And those '50,000 unit' volume prices... Yeah, that's going to set you back all of $200 But if you look at a slightly different version of the product with the same price for a single unit but that reaches a low of 0.3 cents at just 100 units... Well, those 100 units collectively cost 30 cents. While individually they cost 13.8 cents. Anyway, that's off topic really. But fractions of a cent do get used in some context, regardless.
@JW-uC
@JW-uC 6 лет назад
Midrange and Mainframe's do... they use decimals (BCD - packed, signed, unsigned; along with other numerical formats) with the numerical length(s) and the decimal point(s) defined (both in the input fields and the result field independently defined) and with the ability to do rounding (half adjust) that works as expected without the imprecision of floating point calculations. It makes working with accounting or manufacturing data and transactions so much simpler (except where the result is ill defined and an overflow occurs or a lack of precision causes the result to be zero when the answer is less than the fractional part of the number). Its great for its intended use but falls down at the most annoying moments as the initial programming has to make some assumptions that don't always hold up over time.
@ZipplyZane
@ZipplyZane 6 лет назад
Assuming you start with dollars and cents, that works for addition, subtraction, and multiplication, but it doesn't necessarily work for division, since you can get a part of a cent. And sometimes you even do more complex calculations involving higher maths. That said, using fixed decimal does exist, instead of using floating point. But it's going to be more than 2 decimal places. And, even then, it will ultimately have to round.
@christopherlawley1842
@christopherlawley1842 Год назад
My favorite microprocessor, 6502, has BCD built in
@andrewkelley7062
@andrewkelley7062 6 лет назад
At some point I always end up going analog signals instead of digital because of the interface problems like this. It has it's own list of problems like data corruption but for me things like that feel more like a change.
@avi12
@avi12 6 лет назад
4:52 "Because... the average person wants their answers out in decimal, not hexadecimal" Like!
@dexter9313
@dexter9313 6 лет назад
At this point we should really teach hexadecimal to our children and ditch decimal x)
@boriscat1999
@boriscat1999 6 лет назад
I read hexadecimal for a living. I have to review register dumps in order to verify a design before we approve it for manufacturing. (display and camera controllers for an ARM system-on-chip). the 8 digit hexadecimal represents a 32-bit register. And the registers can have multiple fields packed into them, often weird sizes like 5 or 6-bit fields. Horizontal pixel count for display is 13-bits to represent 0 to 8191, and it's packed into the same 32-bit register with the vertical line count. I have scripts that decode the fields for me, but sometimes if something is weird I have to make sure the scripts are working correctly and I must work it out by hand.
@PestOnYT
@PestOnYT 6 лет назад
A note on EBCDIC being E-BCD-IC (extended BCD interchange code) would have been great in this context. Or did I miss it. ;-)
@EebstertheGreat
@EebstertheGreat 5 лет назад
In the NES port of Tetris, a mistake in BCD arithmetic causes levels not to update properly if you start above level 9. The player is always supposed to reach level L after clearing 10*L lines, then leveling up every ten lines thereafter. That way, by starting at a higher level (and therefore faster speed but more points per line), you have a higher scoring potential. For instance, if you start on level 5, you will hit level 6 at 60 lines, then 7 at 70, and so on. But if you start at level 10-15, it takes only 100 lines to reach the next level (same as a level 9 start), 110 for a lvl 16 start 120 for 17, 130 for 18, and 140 for 19. The theory is that to compare L
@pat3658
@pat3658 6 лет назад
I don't get it. What is the need for prepending 4 bit before printing?
@bryede
@bryede 5 лет назад
Classic printers expect a 7 or 8-bit value for every character they print. Since the printer's capabilities will probably include things like 26 upper case, 26 lower case, 10 digits, lots of punctuation and special characters, you begin to see why the values need to be made larger than just the 4 bits being used by a single BCD digit. So, it was decided that the number characters would reside in the ASCII table from 00110000 to 00111001 (characters 48 to 57) so that the conversion could be done quickly by simply slapping 0011 onto the front of the BCD digit. It may be helpful to pull up an ASCII table online and look at how it's all arranged.
@kpunkt.klaviermusik
@kpunkt.klaviermusik 6 лет назад
Is there something like a number format with variable bit length? There are so many formats (integer, word, signed, unsigned, float, double, quad), but there are always numbers, that cannot be stored exactly. A BCD format with variable bitlength (up to millions of decimals) would be really helpful.
@CrushaKRool
@CrushaKRool 6 лет назад
You can't really make it entirely dynamic. It's up to the programmer to decide what a sensible scale is when he uses something like Java's BigDecimal class. Otherwise the code has no way of knowing how far it needs to run a calculation. For example: the result of 1/3 is 0.33333333333... etc. If there was no fixed limit, it could theoretically use up all available space just to store that result, because it never ends. Even if you made a special case for periodic parts of numbers, you'd still have to deal with all the irrational numbers.
@lumer2b
@lumer2b 6 лет назад
Yes there is. There are "infinite" precision integers (limited by system memory) and arbitrary precision floating point numbers.
@lumer2b
@lumer2b 6 лет назад
Yes there is. There are "infinite" precision integers (limited by system memory) and arbitrary precision floating point numbers.
@vylbird8014
@vylbird8014 6 лет назад
It's called 'arbitary precision arithmatic' and it does indeed exist. It's just really slow to compute with.
@Californiansurfer
@Californiansurfer 6 лет назад
Great lecture I always wondered about 42. ASCII is symbols represented bits. That’s the physical level. I love Boolean algebra. I am security teach. I am from Downey ca.
@Lattamonsteri
@Lattamonsteri 6 лет назад
So why is there this thing called floating point error? :S Shouldn't it be very easy to overcome if we're just using ascii or bcd characters?
@stensoft
@stensoft 6 лет назад
Fun fact: all x86 processors have instructions for BCD and they have one-byte opcodes because someone though that they would be used very often.
@NuntiusLegis
@NuntiusLegis Год назад
All 65xx processors have a single one-byte opcode that sets them to BCD mode (no other special BCD instructions needed).
@usethefooorce
@usethefooorce 6 лет назад
At 4:50 -- the "hexadecimal range" (0xa to 0xf) is 10 to 15, not 10 to 16.
@CStuartHardwick
@CStuartHardwick 6 лет назад
Something I've always wondered is, why on Earth did IBM embed punctuation in the middle of the EBCDIC alphabet?
@0LoneTech
@0LoneTech 6 лет назад
For comparison, there's also FIO-DEC that didn't quite make it this easy (1-9 were precisely those values, but the digit 0 was code 20 octal, or 10000 binary). Decimal types nowadays frequently use word cutoffs rather than digit cutoffs, which can fit e.g. 9 digits in 32 bits or 19 digits in 64 bits.
@frankharr9466
@frankharr9466 6 лет назад
That actually reminds me a little be of how PostNET codes used to work. I liked those. I miss 'em.
@ibgib
@ibgib 2 года назад
13:24 - could have sworn he was about to say "digital watches"... On a more thoughtful note, I appreciate how Deep Thought stalled for time to let her kid "Earth" grow up - job security that enabled the great thinker to watch TV while "working".
@willforrhall
@willforrhall 2 года назад
What does this have to do with 42?
@RamLaska
@RamLaska 4 года назад
Computer nerds in 1959: Hmm, if we base our character set on BCD Plus a set number as the most significant nybble, conversions will be super fast and can remain in the registers. Computer nerds in 2019: HURR DUR DURRR DOES IT RUN KRYSIS?!?
@Chrisallengallery
@Chrisallengallery 6 лет назад
Answer to the Ultimate Question of Life, the Universe, and Everything !
@TheStevenWhiting
@TheStevenWhiting 6 лет назад
Has Professor Brailsford retired now? None of these appear to be in his office.
@profdaveb6384
@profdaveb6384 6 лет назад
See reply to Neil Roy (above)
@thecaveofthedead
@thecaveofthedead 2 года назад
I'm an absolute gutter coder with no formal training. I just started learning some 6502 assembly as an interest/hobby, and suddenly a lot of this stuff is beginning to make sense to me. There's a BCD register flag and that was literally the first I'd ever heard of it. While I appreciated that there was a need to represent decimal numbers it wasn't until I watched this that I understood why that would be a hardware feature.
@Distinctly.Average
@Distinctly.Average 4 года назад
Another brilliant video from this amazing man. Also reminded me of the old TO BE thing. T=20, O=15, B=2 and E=5, adds up to 42. Even Shakespeare was in on the joke.
@levmatta
@levmatta 6 лет назад
The point on .1 in binary is super important. I would like to see a video o c# decimals or java BigDecimals.
@levmatta
@levmatta 6 лет назад
Or, to sound fancy, you could call it a decimal power float. Scientific notation joys.
@JimGriffOne
@JimGriffOne 6 лет назад
*
@Jet-Pack
@Jet-Pack 6 лет назад
*thank you*
@frixyg2050
@frixyg2050 6 лет назад
I'm wondering why his go-to example of where you might find a digital clock is a shopping mall. Is it a UK cultural thing? Are malls there known for having digital clocks on the wall or something? (Not trying to poke fun here; genuinely curious.) In any case, another great video from my favorite Computerphile presenter.
@gedsoft3793
@gedsoft3793 Год назад
Can't see this mentioned among the comments? For me the best Douglas Adams joke (which he denied of course) was when the Deep Thought minions declared what they were answering was "What do you get if you multiply six by nine?" and they answered "42" ... well d'oh, but try that in base 13...
@RinksRides
@RinksRides 4 года назад
"controlling elections from punched cards.." - priceless!!
@RedSkyHorizon
@RedSkyHorizon 6 лет назад
I fancy a nybble
@angrymurloc7626
@angrymurloc7626 6 лет назад
42 || !42 - William Shakespeare
@Elesario
@Elesario 6 лет назад
Surely that should be 43||!43?
@DrewNorthup
@DrewNorthup 6 лет назад
@Jason You mean because 0x2bH === 0x43D?
@SuviTuuliAllan
@SuviTuuliAllan 6 лет назад
True?
@superscatboy
@superscatboy 6 лет назад
To A, or not to A? That isn't the question.
@xf99
@xf99 6 лет назад
printf("0x2b | ~0x2b, that is 0xff (%#x) ", 0x2b | ~0x2b);
@williamdavidwallace3904
@williamdavidwallace3904 4 года назад
BCD and the exposure of it's internals was a huge mistake on IBMs part. Sure decimal arithmetic is necessary for many applications. However, the internals of the format should have been opaque with a number of instructions available to manipulate that opaque data type. Exposing the details in languages like Cobol, PL/I and RPG is disastrous especially if one wants to change operations from memory to memory to register to register as large main frames do today. One can emulate decimal arithmetic in the floating point registers if necessary or special instructions could operate of the FP regs to perform decimal arithmetic.
@Ureallydontknow
@Ureallydontknow 3 года назад
I wish he went into the math of binary decimal expansions before floating point.
@xf99
@xf99 6 лет назад
so that's where gluon comes from!
@samgu3750
@samgu3750 6 лет назад
also 42 on the ascii table is '*' which is used (among other things) to reference everything therefore, the answer to the universe and everything . . . is everything want a new universe with a new answer? just find the root directory of the universe and execute "cp * version2.universe". alternatively if you don't like the answer, delete it. i'm sure nothing bad will happen when "rm *" is run on the root of the universe
@fllthdcrb
@fllthdcrb 6 лет назад
I'd like to point out that IBM's predecessor to Deep Blue _was_ in fact named "Deep Thought". Not sure why Prof. Brailsford forgot or didn't know about that one.
@Ognastay
@Ognastay 5 лет назад
Sort of: Deep thought: The ultimate "answer" to the TLTU&E *is* 42. The reason why humans couldn't understand it is because they didn't know the ultimate "question" to TLTU&E. Since Deep thought couldn't calculate the ultimate question, earth was created to calculate that. Earth: [4.5 billion years later] the ultimate "question" to TLTU&E is... (just nanoseconds from earth completing its calculations, the vogon space fleet destroyed it to make room for the intergalactic highway) Magraethea (Earth 2.0): since Arthur Dent is the only surviving earthling and element to the ultimate "question", his brain could be used to reboot the program.
@XenXenOfficial
@XenXenOfficial 3 года назад
0:18 He who controls the spice controls the universe
@georganatoly6646
@georganatoly6646 2 года назад
It's kind of interesting how this kind of knowledge is largly removed from the everyday programmer's required knowledge set and experience, apart from assembly and embedded systems writers
@Jet-Pack
@Jet-Pack 6 лет назад
b.. b.. but the 42. Ascii character (ascii dezimal) is the wildcard character * That means everything is the answer to life, the universe and everything!
@El_Grincho
@El_Grincho 6 лет назад
6*9=42, at least in base 13.
@robinwells8879
@robinwells8879 3 года назад
Depth of knowledge is wonderful but when you have depth breadth and width it’s awesomely interesting. Perhaps we could further examine developments in American vote counting equipment and what is entailed when you don’t have to count votes. Is it just a random number generator or does it work backwards from the pre programmed outcome? 😉 I’ll get my coat......sounds of tumble weed!
@INeedAttentionEXE
@INeedAttentionEXE 6 лет назад
I figured out that that I needed to convert my binary digit to bcd to shift it to my digital display, I swiftly gave up because it was way to complicated
@robfielding8566
@robfielding8566 2 месяца назад
why not just use integer cents for money?
@mike0rr
@mike0rr 3 года назад
Every MineCraft Calc guy out there: I understand BCD, but what is Binary?
@allenjenkins7947
@allenjenkins7947 4 года назад
Is it just me, or does he look and sound a bit like Richard Bucket (Clive Swift) "Keeping up Appearances".
@puttanesca621
@puttanesca621 6 лет назад
Deep thought was a least in part a parody of an earlier science fiction short story "The Last Question" by Issac Asimov which too itself much more seriously (for better or for worse).
@JW-uC
@JW-uC 6 лет назад
I really enjoyed that story, The last question, one of my favourites. Thanks for the memory jog.
@vzolin
@vzolin 3 года назад
Fiat lux
@brendanmccabe8373
@brendanmccabe8373 6 лет назад
There are 10 types of people in the world 1. those who understand binary 2. those who don’t 3. those who didn’t expect this joke to be base 3
@dantebroggi3734
@dantebroggi3734 6 лет назад
FYI, The correct way to type this would be: ``` There are 10 types of people in the world 01. those who understand binary 02. those who don’t 10. those who didn’t expect this joke to be base 10 ```
@maxsnts
@maxsnts 6 лет назад
Actually, by that logic it would be: There are 11 types of people in the world 01. those who understand binary 10. those who don’t 11. those who didn’t expect this joke to be base 11
@MrCyanGaming
@MrCyanGaming 6 лет назад
I think you mean 1 2 10
@nikoerforderlich7108
@nikoerforderlich7108 6 лет назад
There are 10 types of people in the world: Those, who understand base two jokes; those, who understand base three jokes; those, who understand base four jokes; those, ....
@WarmongerGandhi
@WarmongerGandhi 6 лет назад
There are 10 types of people in the world: People who understand hexadecimal, And f the rest
@AB-Prince
@AB-Prince 6 лет назад
Didn't know what BCD meant till now
@kwinvdv
@kwinvdv 6 лет назад
I expected at least a mentioning of the double dabble algorithm.
@Computerphile
@Computerphile 6 лет назад
Next video :)
@gordonrichardson2972
@gordonrichardson2972 6 лет назад
He mentions in the video that it takes a fair amount of work to convert a binary number into a BCD for output. Going into more detail would turn off a lot of viewers.
@kwinvdv
@kwinvdv 6 лет назад
Gordon Richardson But this is computerphile, since it is not like they never explained algorithms before on this channel. I suspect that this was more of an introduction video, since the next video will be about it.
@WildEngineering
@WildEngineering 6 лет назад
I built a BCD in -> Binary Out (16bit) in Minecraft hahaha. Its as small as it can be.
@Drakcloud65
@Drakcloud65 6 лет назад
I can't understand anything but I love his voice
Далее
Where did Bytes Come From? - Computerphile
11:31
Просмотров 475 тыс.
ТРОЛЛИНГ СКАМЕРА СТАНДОФФ 2
00:59
The Journey to 3264 - Numberphile
19:38
Просмотров 191 тыс.
Transport Layer Security (TLS) - Computerphile
15:33
Просмотров 473 тыс.
Ep 007: Packed Binary Coded Decimal
11:47
Просмотров 5 тыс.
Bootstrapping EDSAC: Initial Orders - Computerphile
15:38
Sleeping Beauty Paradox - Numberphile
15:45
Просмотров 316 тыс.
Six Sequences - Numberphile
13:48
Просмотров 437 тыс.
Why Use Binary? - Computerphile
8:29
Просмотров 664 тыс.
EDSAC Simulator - Computerphile
18:29
Просмотров 122 тыс.