Author Topic: Dilbert: "We could only program with 0s"  (Read 11372 times)

0 Members and 2 Guests are viewing this topic.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #15 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.
« Last Edit: October 24, 2011, 02:01:54 am by willrandship »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Dilbert: "We could only program with 0s"
« Reply #16 on: October 24, 2011, 09:34:23 am »
How would that work? O.o There'd be only one command, wouldn't there?




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #17 on: October 24, 2011, 02:15:58 pm »
It would be NOP :trollface:
« Last Edit: October 24, 2011, 02:18:10 pm by Builderboy »

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #18 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

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Dilbert: "We could only program with 0s"
« Reply #19 on: October 24, 2011, 03:55:47 pm »
Though you could always use LD A,A to do the same thing ;D




Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #20 on: October 29, 2011, 11:17:37 pm »
Use zeros... And spaces?

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #21 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.
« Last Edit: October 29, 2011, 11:26:39 pm by willrandship »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #22 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).
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #23 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.
« Last Edit: October 30, 2011, 12:02:51 am by willrandship »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #24 on: October 30, 2011, 12:12:25 am »
That's not an unary computer. That's a binary computer with unary opcodes.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Dilbert: "We could only program with 0s"
« Reply #25 on: October 30, 2011, 12:32:06 am »
That reminds me of Whitespace, a language composed entirely of spaces, tab spaces, and newline spaces.




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #26 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

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #27 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.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #28 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.

∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Dilbert: "We could only program with 0s"
« Reply #29 on: October 30, 2011, 02:18:36 pm »
No, I meant higher than binary is already used in RAM.