Omnimaga

General Discussion => Other Discussions => Humour and Jokes => Topic started by: Hot_Dog on October 18, 2011, 03:47:33 pm

Title: Dilbert: "We could only program with 0s"
Post by: Hot_Dog on October 18, 2011, 03:47:33 pm
This comic is funny, because any program with nothing but 0s does absolutely nothing
Title: Re: Dilbert: "We could only program with 0s"
Post by: turiqwalrus on October 18, 2011, 03:52:20 pm
or the letter 'O'
the program would throw up an error :P
Title: Re: Dilbert: "We could only program with 0s"
Post by: Hot_Dog on October 18, 2011, 03:53:31 pm
or the letter 'O'
the program would throw up an error :P

Lol

What I mean is, you always have to have 1s with 0s.  If you feed the processor nothing but zeros, the processor is going to sit on its rear and twiddle its thumbs.
Title: Re: Dilbert: "We could only program with 0s"
Post by: Yeong on October 18, 2011, 03:57:52 pm
0x5
Title: Re: Dilbert: "We could only program with 0s"
Post by: AngelFish on October 18, 2011, 05:07:31 pm
This comic is funny, because any program with nothing but 0s does absolutely nothing

Hehe, maybe on z80. SuperH will throw an exception and run an error handler if you feed it nothing but 0's. The error handler will then beam you into the Tron world (using the Organic Virtualization module available as standard on SuperH's) and proceed to torture you mercilessly until you apologize for feeding the processor bad opcodes.
Title: Re: Dilbert: "We could only program with 0s"
Post by: Spyro543 on October 18, 2011, 05:19:36 pm
The error handler will then beam you into the Tron world
/me starts smashing the 0 key
Wait - Original Tron world or Tron Legacy world? And if Tron Legacy, is it Pre-CLU or Post-CLU?
Title: Re: Dilbert: "We could only program with 0s"
Post by: harold on October 18, 2011, 05:37:32 pm
add [eax],al
Title: Re: Dilbert: "We could only program with 0s"
Post by: flyingfisch on October 18, 2011, 05:50:50 pm
reminds me of something my dad used to tell us when we didnt wanna go to school

Quote
When I was your age, I had to WALK 5 miles, uphill, both ways to get to school!

The joke being that unless the earth has tides, you cant walk uphill both ways.
Title: Re: Dilbert: "We could only program with 0s"
Post by: NanoWar on October 18, 2011, 06:05:03 pm
Well, you sure can: http://klasse.eichelsdoerfer.net/escher_treppe_2.jpg :) .
Title: Re: Dilbert: "We could only program with 0s"
Post by: Deep Toaster on October 18, 2011, 06:37:28 pm
I can program with semicolons!
Title: Re: Dilbert: "We could only program with 0s"
Post by: parserp on October 18, 2011, 06:42:41 pm
Well, you sure can: http://klasse.eichelsdoerfer.net/escher_treppe_2.jpg :) .
ooh one of those endless staircases...
I can program with semicolons!
I program with .5's. O0
Title: Re: Dilbert: "We could only program with 0s"
Post by: Eeems on October 18, 2011, 07:19:12 pm
reminds me of something my dad used to tell us when we didnt wanna go to school

Quote
When I was your age, I had to WALK 5 miles, uphill, both ways to get to school!

The joke being that unless the earth has tides, you cant walk uphill both ways.
Yes you can, if there is a hill in between. You walk up the hill then down it no matter which way you go.
Title: Re: Dilbert: "We could only program with 0s"
Post by: Deep Toaster on October 18, 2011, 07:28:22 pm
Wow, that's actually a really simple solution.
Title: Re: Dilbert: "We could only program with 0s"
Post by: Builderboy on October 18, 2011, 07:32:45 pm
But it's not 5 miles uphill, its 2.5 miles uphill and 2.5 miles downhill :P
Title: Re: Dilbert: "We could only program with 0s"
Post by: Deep Toaster on October 18, 2011, 07:43:45 pm
But there's a comma in between! That makes all the difference :D

And we're getting really off track, but that reminds me of this: Million-Dollar Comma May Aid Canadian Company (http://www.npr.org/templates/story/story.php?storyId=6383383)
Title: Re: Dilbert: "We could only program with 0s"
Post by: willrandship on October 24, 2011, 02:01:28 am
actually I can program in only one symbol. let me write an interpreter first tho :P Is it ok if it only has four to eight commands?

It's called unary btw.
Title: Re: Dilbert: "We could only program with 0s"
Post by: Deep Toaster on October 24, 2011, 09:34:23 am
How would that work? O.o There'd be only one command, wouldn't there?
Title: Re: Dilbert: "We could only program with 0s"
Post by: Builderboy on October 24, 2011, 02:15:58 pm
It would be NOP :trollface:
Title: Re: Dilbert: "We could only program with 0s"
Post by: Hot_Dog on October 24, 2011, 03:34:57 pm
You know, we always talk about how NOP is a useless instruction, but actually, ld a, a etc. are the only useless instructions on the z80.  NOP DOES have its purposes
Title: Re: Dilbert: "We could only program with 0s"
Post by: Deep Toaster on October 24, 2011, 03:55:47 pm
Though you could always use LD A,A to do the same thing ;D
Title: Re: Dilbert: "We could only program with 0s"
Post by: epic7 on October 29, 2011, 11:17:37 pm
Use zeros... And spaces?
Title: Re: Dilbert: "We could only program with 0s"
Post by: willrandship on October 29, 2011, 11:23:30 pm
actually, it involves counting the numbers of 0s.

think tally marks, minus the 5 groupings. That's unary. Binary allows having ones separating the zeros, but unary doesn't, so (I'm representing the bits as one for clarity) 111111 = 1+1+1+1+1+1 = 6 , or command #6.

As such, it's easy to make a binary processor pretend to be unary, just as a quaternary one can easily pretend to be binary.

@epic7 zeros and spaces would be two symbols, and therefore binary.

An 8 bit CPU would have 9 possible states: {},{1},{11},{111},{1111},{11111},{111111},{1111111},{11111111}

and each wire would be powered after the previous, so it's easy to convert from an analog voltage by using compariters.

Binary is much better, of course. quaternary is better than binary in the same way.
Title: Re: Dilbert: "We could only program with 0s"
Post by: AngelFish on October 29, 2011, 11:51:25 pm
actually, it involves counting the numbers of 0s.

think tally marks, minus the 5 groupings. That's unary. Binary allows having ones separating the zeros, but unary doesn't, so (I'm representing the bits as one for clarity) 111111 = 1+1+1+1+1+1 = 6 , or command #6.

As such, it's easy to make a binary processor pretend to be unary, just as a quaternary one can easily pretend to be binary.

@epic7 zeros and spaces would be two symbols, and therefore binary.

An 8 bit CPU would have 9 possible states: {},{1},{11},{111},{1111},{11111},{111111},{1111111},{11111111}

and each wire would be powered after the previous, so it's easy to convert from an analog voltage by using compariters.

Binary is much better, of course. quaternary is better than binary in the same way.

That wouldn't work. Memory has to be initialized to some set of states, so unary is impossible. Let's take a look:

Let's say we have a turing machine where all the cells on the tape can hold a unary 1 and that's it (it's unary, remember). Now, the machine looks at the first step and sees a 1. So, does it read that as {1} or {11} or {111} or any of the other possible combinations? Let's say it decides based on some magic oracle that it's not {1}, so it looks at the next cell and sees another 1. That narrows the choice down to {11}, {111} and so on. There is no way on the basis of the information provided in the memory tape to distinguish between the opcodes. The machine can have at most one instruction and since memory cannot be modified (unary memory sucks), it can't possibly be Turing complete. Basically, an Unary computer can execute any one instruction repetitively so long as that instruction is trivial (e.g. a NOP or outputting a constant value on a line).
Title: Re: Dilbert: "We could only program with 0s"
Post by: willrandship on October 30, 2011, 12:02:12 am
it has to read them all until it reaches a zero. The reader function is in binary, but the inputs and outputs are in unary, similar to how an ADC has to have analog parts even though it is a portion of a digital circuit.

An Unary computer is a very poorly designed binary computer, in that it would be trivial to convert an unary computer to a binary one. The memory would have to be binary, but have no 0s before the last 1, or be an analog method (ie voltage based, capacitors would do the job) stating the count.

Let me try to clarify: Unary vs binary is like the following:
Two methods of storing a square tower's geometry: Plain height in a number (tower is 5 or, in unary, 11111 blocks high) is like unary, where saying whether each level has a window, and counting the bits, is like binary. (10101) Note that the binary form stores more data for its size.
Title: Re: Dilbert: "We could only program with 0s"
Post by: AngelFish on October 30, 2011, 12:12:25 am
That's not an unary computer. That's a binary computer with unary opcodes.
Title: Re: Dilbert: "We could only program with 0s"
Post by: Deep Toaster on October 30, 2011, 12:32:06 am
That reminds me of Whitespace (http://compsoc.dur.ac.uk/whitespace/), a language composed entirely of spaces, tab spaces, and newline spaces.
Title: Re: Dilbert: "We could only program with 0s"
Post by: Builderboy on October 30, 2011, 12:44:55 am
Indeed, it is impossible to program using *only* 0's without using something like grouping.  This however adds in more information than just the 0's themselves provide, so you are not using *only* 0's
Title: Re: Dilbert: "We could only program with 0s"
Post by: willrandship on October 30, 2011, 01:42:49 am
But it is only 0s in the programs, which was what was stated in the dilbert comic. Note it only stated "Programming in zeros" :P

Also,
Quote
That's not an unary computer. That's a binary computer with unary opcodes.
can be defined as an unary computer. Did you know that the vast majority of RAM already relies on higher-base storage concepts? Yet, it is part of a binary computer system.
Title: Re: Dilbert: "We could only program with 0s"
Post by: AngelFish on October 30, 2011, 03:00:11 am
Quote
Did you know that the vast majority of RAM already relies on higher-base storage concepts? Yet, it is part of a binary computer system.

That's because the fundamental unit of information is the bit, which coincidentally, is the same unit used in binary ;) Notice that the bit contains more information than a unary digit. As Builderboy said (and you implied with the statement that "it has to read them all until it reaches a zero"), with *ONLY* 0's, you can't build a computer using unary instead of binary. There just isn't enough information in unary digits by themselves to determine multiple opcodes. Additional information in the form of formatting is inherently necessary.

Title: Re: Dilbert: "We could only program with 0s"
Post by: willrandship on October 30, 2011, 02:18:36 pm
No, I meant higher than binary is already used in RAM.