Original KENBAK-1 Speed Measurement

83 views
Skip to first unread message

Ardunaut

unread,
Sep 22, 2021, 3:34:05 PM9/22/21
to uKenbak-1
Based in the YouTube video of an original Kenbak-1 free running showing a binary counter:
Using a video capture program and MovieMaker to measure the blinking period of bit-7:

ON/OFF changes of the bit 7:
  ON     00:00.50
  0FF    00:01.30
  ON     00:02.10
  0FF    00:02.90
  ON     00:03.60
  0FF    00:04.40
  ON     00:05.20 
  0FF    00:06.00    
  ON     00:06.80     

Blinking period = (6800-500) / 4 cycles  = 1575 milliseconds/cycle

This is the time of the program loop "increment-show-jump back" done 256 times.

Then the period of the program loop is  = 1575/256 milliseconds = 6 milliseconds

Assuming the faster program loop is something like this:

   LOOP:  ADD A,C=001   ; Increment A
          STORE A,200   ; Show A on the LEDs (OUTPUT).
          JPD   LOOP    ; Jump direct to LOOP

Each instruction last 2 milliseconds approximately.

Looks like the kenbakuino needs 2 microseconds delay to get close to the KENBAK-1 original speed:

    Holding switch [bit-2] and pressing [STOP] ->(2 microseconds delay between instructions):

This must have been done by someone before, but I share it anyway, Live long and Prosper... :-P

Kenbak-1_Real_Speed.png
Message has been deleted

Ardunaut

unread,
Sep 22, 2021, 4:42:08 PM9/22/21
to uKenbak-1

Second correction (bit-1) and (milliseconds)!, will be nice the option of message edition:

Holding switch [bit-1] and pressing [STOP] ->(2 milliseconds delay between instructions)

Tested with my new full size #KENBAK-1, by the way :-)
2021-09-22 15.48.56.jpg

Mike Corrigan

unread,
Sep 22, 2021, 6:51:51 PM9/22/21
to uKenbak-1
This is very interesting, and it answers a question I've had about the original Kenbak-1.

I've seen lots of statements on various web sites regarding the 'speed' of the Kenbak.  Some say that the clock speed is 1Mhz, some say that the oscillator is 1Mhz, some even say that the instruction cycle time is 1Mhz, or even worse that it executes 1 megaflop.  In the Kenbak-1 Threory of Operation manual it says that oscillator runs at twice the system clock speed, but it doesn't say what speed it actually is.  This video demonstrates that the clock speed is 1Mhz, the oscillator is 2Mhz. 

The clock speed of 1Mhz is the rate at which bits are shifted through the memory.  The two 1K shift registers run in parallel, so every memory byte is available once every 1024 clocks, or about every millisecond.  Since every instruction begins with a fetch of the program counter (at address 3), every instruction must take an integer multiple of 1024 clocks.  It is easier to think about this in terms of byte clocks rather than bit clocks, so this is equivalent to saying that every instruction takes an integer multiple of 128 byte clocks.  Based on the state machine described in the Theory of Operation manual, you can predict how many complete cycles through the memory each instruction will take.  For the three instructions desribed here you can compute that they will take: 

        the 'add a,c=1' instruction takes 1 trip through the memory (128 byte cycles) or about 1ms
        the 'store a,200 ' instruction takes 2 trips through the memory (256 byte cycles) or about 2ms
        the 'jpd loop' instruction also takes 2 trips, or 2ms. 

Of course that only adds up to 5ms, while the video shows the loop taking 6ms.  It turns out that any instruction located at address 4 takes an extra trip around the memory, adding the 6th millisecond.  (This is because after fetching the program counter at address 3, it is too late to fetch the instruction at the very next address (4), so the machine has to wait for 4 to come around again 1ms later) Therefore the loop running in the video must have started at address 4.

I've built a simulator which simulates the state machine (as described in the Theory of Operation manual, and have run a number of programs through it.  Typically, the average instruction time is around 256 byte cycles (now seen to be about 2ms).  The longest running instruction I've been able to concoct is a 'load x,(1)+x', located at address 4, location 1 (reg B) containing the value 1 and location 2 (reg X) containing the value 0.  This instruction takes 6 trips around the memory, or 768 byte cycles totalling 6ms.

Charley Jones

unread,
Sep 23, 2021, 12:29:48 PM9/23/21
to Mike Corrigan, uKenbak-1
Fascinating!

Sent from my iPhone 12pm!
Charley Jones, PMP

On Sep 22, 2021, at 3:51 PM, Mike Corrigan <mike...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "uKenbak-1" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukenbak-1+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ukenbak-1/18163dbe-b6b8-495f-8af8-660f62efd710n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages