Simpler than Ben Eater's SAP-1?

Поділитися
Вставка
  • Опубліковано 29 сер 2022
  • Turing SAP1. An alternate take on the design of this very simple machine.
    I answer the deeper philosophical question of why this is even a computer.
    Don't forget to watch all three videos in the series (about 90mins watch time)
    Part 1 is on the Rulebook (AKA finite state machine)
    Part 2 is on the Notepad (memory system with some theory thrown in)
    Part 3 is on programming the Rulebook.
    There is a very special surprise at the end of Part 3.
    The schematic is available at
    github.com/Turing6502/TuringSAP1
    Turing SAP1 Schematic.pdf
    Emulator and EPROM generator (Visual Studio 22 - which is free)
    TSAP1.zip
    A more detailed analysis is available on this playlist
    • Turing 6502

КОМЕНТАРІ • 85

  • @michaelheuss6502
    @michaelheuss6502 Рік тому +25

    I think it depends on your definition of "simple". Fewer parts and a streamlined design? Yup. Easier for me to wrap my poor brain around? Most certainly not. :) But the explanations are excellent. Thank you!

    • @DrMattRegan
      @DrMattRegan  Рік тому +8

      Thanks, yes, that's why it's posed as a question rather than a statement. You might want to look at the Pure Turing ua-cam.com/play/PLjQDRjQfW-87Jbng4CllA9G12HLar0iF8.html or Turing6502 ua-cam.com/play/PLjQDRjQfW-84j-jLvrbEeDvGl0QrhX9p7.html playlists to get a better idea about how it works.
      Takes a bit of commitment, but once the penny drops, it's much more straight forward than it appears.

    • @e8root
      @e8root Рік тому +1

      Exactly my impression. Less parts doesn't mean design is any easier to understand and/or use. For circuits which do very specific things this might be good approach than throwing more chips and microcontrollers at the problem.

  • @ColonelTux
    @ColonelTux 24 дні тому

    I'm just learning about digital circuit design. The idea to use an EPROM and a D-latch buffer as a finite state machine, and make that the core of your CPU design is so elegant! I'm continually impressed by all the brilliant people over the years who have contributed to this corpus of design techniques that make all these systems possible.

    • @DrMattRegan
      @DrMattRegan  23 дні тому

      Thanks for the feedback, enjoy the series. I actually like part 2 better in this series. I'm keen to hear what you think about part 2

    • @ColonelTux
      @ColonelTux 23 дні тому

      @@DrMattRegan It was interesting how you introduced the concept of Turing completeness to justify the idea that all you needed to add to your finite state machine was the ability to access sequential memory in order to emulate the SAP-1. I was surprised again to see that you could vastly simplify the circuit by putting all the registers in RAM, except of course the address register. It's so obvious in hindsight, but I would not have thought of it. You also wind up with far fewer control lines. I would have liked to have seen a discussion on how that impacts performance (number of clock cycles for an operation).
      I didn't read through the comments to see what others said, but I think the two stack FSM should be Turing complete. By popping values off one stack and pushing them on the other you are effectively moving through a sequential memory.

    • @DrMattRegan
      @DrMattRegan  17 днів тому +1

      Yes, the two stack FSM is Turing complete.
      I go over a 1-bit 6502 design in the Pure Turing playlist.
      The first machine even has a sequential access memory.
      It takes about 3 million clocks per 6502 instruction.
      Most of that is skipping out read and write the memory.
      When you add in random access main memory, it goes down to about 3000 clocks/instruction.

  • @edgeeffect
    @edgeeffect Рік тому +2

    Lots of people are building on Ben Eater's machine but, of what I've seen, this one is adding a lot more LEARNING... which is the whole point of building an SAP in the first place. NICE!

  • @ARBB1
    @ARBB1 Рік тому

    What a great idea. It's great as a teaching tool too.
    Thanks for the video.

  • @xotmatrix
    @xotmatrix Рік тому +5

    Those commonly available header strips will quickly ruin a solderless breadboard but with a little searching you can find similar headers with slimmer pins that fit into solderless breadboards beautifully. I'm looking forward to the rest of this series.

    • @zbradbell
      @zbradbell Рік тому

      yep - round machined headers, easy to find

    • @DrMattRegan
      @DrMattRegan  Рік тому

      I suspect they will probably destroy the boards, but i think one off use is OK.
      Once i've built a board i usually don't disassemble them. I'm sure i'll come up with a new idea for
      a video the moment i pull it apart.

    • @zbradbell
      @zbradbell Рік тому

      @@DrMattRegan yeah, especially if it’s a better quality board (not steel contacts)

    • @DrMattRegan
      @DrMattRegan  Рік тому +2

      The other thing was switching from 74HC374 -> 74HC574 which have all the inputs on one side and outputs on the other.

  • @byronwatkins2565
    @byronwatkins2565 Рік тому +6

    This is very clever! But, it serves a different purpose than Ben Eater's series. Ben shows how each component of a computer can be made from simple binary logic and then shows how each subsystem plays its unique role in the overall computer architecture.

    • @DrMattRegan
      @DrMattRegan  Рік тому +3

      Thanks. I didn't want to just go over the same ground Ben already covered. Next video will be up soon, i'd be interested to see what you think.

  • @lindoran
    @lindoran Рік тому +1

    Thanks this made FSM's actually digestible for my brain space. Very informative!

  • @TradieTrev
    @TradieTrev Рік тому

    Mad dog! Love your work mate; Really love your explanation!

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Thanks, glad you’re getting some value from it.

  • @dutchsailor6620
    @dutchsailor6620 Рік тому

    Instead of messing around with breadboards and unreliable connections, I build the SBC in Proteus. Works flawless in the simulator in real time.

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Yes, each to their own. I like seeing hardware coming to life myself.

  • @dt1165
    @dt1165 Рік тому +1

    Excellent!

  •  Рік тому

    I made the same PCB jumpers for exactly the same reason hehehe
    As always, I love your videos and the work behind it.

  • @thek3743
    @thek3743 Рік тому +1

    Very different, and very interesting

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      Thank you! Cheers! Two more parts to the series.

  • @MichaelSamerski
    @MichaelSamerski Рік тому

    Brilliant video thank you

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Enjoy! You might like the Turing6502 series too.

  • @e8root
    @e8root Рік тому +1

    This reminds me of old style mechanical devices with motors and various levers. Number of parts was very important and engineers used all tricks to simplify design some times making it quite hard to understand internal logic.

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      If you've got some time up your sleeve (several hours), i'd recommend watching this playlist ua-cam.com/play/PLjQDRjQfW-84j-jLvrbEeDvGl0QrhX9p7.html
      It goes over the theory in more detail.

  • @derekchristenson5711
    @derekchristenson5711 10 місяців тому

    Very interesting! Also, it may be unnecessary, but I found the repeated "Knightrider" theme amusing every time. ;-)

    • @DrMattRegan
      @DrMattRegan  10 місяців тому +1

      Cool. The second video in this series (Memory) is one of my favorite videos. Let me know what you think.

  • @d.jensen5153
    @d.jensen5153 Рік тому

    Your VGA by ROM design crossed my radar screen for the first time yesterday. (Video generation has long been near and dear to my heart.) The very next day The Algorithm brings me SAP-1. Nothing to do now but subscribe!
    I have some GALs and a PAL programmer from back-in-the-day. Was going to make a SAP-type machine out of 16V8s, an SRAM, and an EPROM. The latest idea was to use the GALs in a bit-slice fashion, sort of à la PDP-8.

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Welcome. If you are serious about building a machine, you might want to look at the SAP-6502 playlist. It's the same architecture as the SAP-1 but it's been bulked up to run 6502 machine code. The microcode is available through github and i'm concurrently doing a series explaining how the microcode works.

    • @d.jensen5153
      @d.jensen5153 Рік тому

      @@DrMattRegan I think your approach to SAP-6502 is absolutely brilliant! The way you leverage giant inexpensive EPROMs, and the way you use C to create their contents, was amazing! As far as throughput goes, do you think your SAP-6502 capable of 1 MIP? Or if not, would it at least be capable of the throughput of an NMOS 6502 clocked at 1 MHz?

    • @DrMattRegan
      @DrMattRegan  Рік тому

      I’ve had the Turing6502 running at 3.579MHz which is about 50% faster than the native 6502. You might want to check out that playlist as well.

    • @d.jensen5153
      @d.jensen5153 Рік тому

      @@DrMattRegan Perfect! Many thanks!

  • @AJB2K3
    @AJB2K3 Рік тому

    Cool idea with the BUS pcbs

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Thanks, it really made the build much easier

  • @colonelbarker
    @colonelbarker Рік тому

    This is a really interesting video, I'm really keen to see where it goes. Have you pushed it to see how fast it will run? Slu4 got his breadboard CPU to push quite a few mhz recently!

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      I was amazed he could get 8 MHz on a breadboard. I struggle above 1 MHz on breadboard. Even If they run, they are unreliable. The PCB version of Turing6502 runs at 3.58 MHz. I have some 50 ns EPROMs/SRAM, I might crank this board to see how it goes. Below 250k is usually for fine. Some of the PureTuring examples had to run for days error free to get enough data to see Pac-Man move.

    • @colonelbarker
      @colonelbarker Рік тому

      @@DrMattRegan it's an amazing series of projects you have done. I really enjoy your explanations of why you have made the choices you have and how they are implemented.
      If I had to offer minor negative feedback it would be the nightrider gag got a little old for me. But I'm also too young to have seen the series!

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      @@colonelbarker all feedback is good 👍. It’s funny I was talking to someone else about it tonight and they said keep knight ridder thing to a single video.

    • @colonelbarker
      @colonelbarker Рік тому

      @@DrMattRegan that might be the way. It's great method for testing that the state machine is working.
      I'd love a video explaining the difference in the two state machine models you mentioned. It sounds like an interesting topic!

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Good idea

  • @MichaelKamprath
    @MichaelKamprath Рік тому +2

    Ha! I didn't think I was "taking it to the extreme", I was just trying to do more complicated math 🙂
    I am curious how you will do the math with no ALU. I think I see it with the EPROM, but I will await your next video to learn.

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      Hi Michael. Great to hear from you, i've been watching you develop PUTEY-1 from the start, it's getting pretty close to the 8-bit CPUs of the era. Hope you don't mind me mentioning it !
      Yep, it's all done with the EPROM, next video should be out soon, (i'm sure you know that editing is the longest part of the process).

    • @MichaelKamprath
      @MichaelKamprath Рік тому +1

      @@DrMattRegan Oh, I didn't mind, I was just surprised to here my PUTEY-1 referenced. I'll look forward to your next video.

    • @DrMattRegan
      @DrMattRegan  Рік тому

      @@MichaelKamprath new video is up. Let me know what you think when you get a chance to see it.

  • @YateyTileEditor
    @YateyTileEditor Рік тому +1

    Which 74HC574 have you found that has a reset? I would have loved that but I had to settle for '273 instead

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      Yes, you need weak pulldown resistors on the outputs and reset is actually the output enable signal. I'm a recent convert to the 574 but it makes the jumper boards much easier

  • @adamrak7560
    @adamrak7560 Рік тому

    You can absolutely program FPGAs by programming the CLBs manually, without any abstractions.
    You can tell what bits you want inside the CLB and where the CLB should be, and how it connects to other CLBs.
    The compiler only does the routing in this case, which you can inspect if you really need to (I had to).
    You may even control the routing too, basically sidestepping the compiler, but that can be difficult depending on which type of FPGA you want to program.

    • @DrMattRegan
      @DrMattRegan  Рік тому

      At a guess, what percentage of people who use FPGAs use their own routing? I suspect you may be the exception to the rule, but that doesn't necessarily disprove the rule.
      I would say the vast majority use an HDL, so there is a layer of abstraction except for the super user.
      Some people like to re-write the microcode in their x86 machines, they are skipping the abstraction also.

  • @mheermance
    @mheermance Рік тому

    My guess for the seven bit board is that it's for output and ASCII is a seven bit code. But for testing you wanted to make sure all eight were working. As an aside it's good that the data bus pins in those chips are contiguous and in the same order. I have worked with a few chips where they're not and you wonder why the IC design engineers thought it was a good idea.

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      Good guess! But it was a much more practical reason. I do want to run 8-bits of the w-bus up to the top of the board.
      The maximum distance between the busses on that side of the 27C322 was 4 pins. So to keep everything aligned at the top of the board, the busses can only be 4 pins apart. The SRAM on the lower left uses the bottom 4 pins for data and ground, so the w-bus needs to abut the SRAM chip, but when I tried the 8-pin board I couldn’t squeeze it in.
      Martin, you’ve watched most (if not all) of my videos, I’m trying to approach the same material from different angles, what do you think?

    • @mheermance
      @mheermance Рік тому

      @@DrMattRegan I like how you are showing how this simple machine can emulate other more complex machines. The part count was especially instructive. It does it by moving the complexity into the rulebook which is essentially software. It's sort of the logical conclusion to RISC and shows how all computers have the same capabilities. Although those big EPROMs themselves have a lot of complexity stashed away inside them!

    • @DrMattRegan
      @DrMattRegan  Рік тому +2

      @@mheermance true, there is considerable engineering behind the memories. What I’m hoping to achieve is to basically show the nugget at the core. So when people see really complex architectures they don’t get intimidated and can break it into pieces. I worked in the Architecture group at Nvidia during the Tesla and Fermi period and it was the only way to understand the GPU.

  • @skilz8098
    @skilz8098 Рік тому

    What would be interesting would be to build a simulated NES on a breadboard... As for the cartridges or the games (roms)... that's were EEPROMS would come in. Just have an external board that you'd plug your EEPROM into and connect that to the systems input bus. Now as for the display, audio and the controllers that'd be a different story. However, I think that this would be a pretty cool project to complete.

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      I think the CPU side would be straightforward, its the PPU that would be the killer.

    • @skilz8098
      @skilz8098 Рік тому

      @@DrMattRegan Yeah, I had the same sentiments. The APU could be issues too. However, you could do 3 different bread board builds, one of the CPU, one for the PPU, and one for the APU and have them connected in the same manner as the original NES bus. Then the fourth module would be the I/O interface for the cartridges, controllers, and a/v outputs.
      It would be a fairly big build. It would also be an interesting build to see a working NES on a breadboard. However, the timings could be an issue due to the limitations of the bread boards and the sizes and lengths of the wires...

  • @The_Real_Grand_Nagus
    @The_Real_Grand_Nagus 2 місяці тому

    If they contain ducks, then are the really pidgeon holes?

    • @DrMattRegan
      @DrMattRegan  2 місяці тому +1

      Well, yes. But what about metaphorical ducks in metaphorical pidgeon holes?

  • @paulstubbs7678
    @paulstubbs7678 Рік тому

    Interesting, although I'd like to see it transferred to a PCB, as tying up that many proto boards seems wrong.
    As for the EPROM state machine, I was thinking of a design using just an eprom, with the clock going into one of the address pins, so the EPROM has two almost the same banks that get alternated between by the clock.
    There is of course one big downside to this machine, all your code is hard coded into an EPROM, no keypad or serial port to allow code entry, so one is stuck forever erasing chips.

    • @DrMattRegan
      @DrMattRegan  Рік тому

      You might want to watch the last 5 mins of the third video!

  • @greenerell484
    @greenerell484 9 місяців тому

    using EEPROM truth tables still TTL ?

    • @DrMattRegan
      @DrMattRegan  9 місяців тому

      Well, Gigatron calls itself a TTL machine and it uses a big ROM. Can't think of too many "TTL CPUs" that don't use microcode in a ROM. TTL somewhat means not an FPGA or software core.

  • @TheOvvl
    @TheOvvl Рік тому

    Calculating Fibonacchi sequence?

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Huh??

    • @TheOvvl
      @TheOvvl Рік тому

      @@DrMattRegan Interesting work! But wich numbers on display?

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      @@TheOvvl Fibonacci sequence which is the sum of the last two numbers displayed.

  • @honkhonk8009
    @honkhonk8009 11 місяців тому

    6:00
    Same here lol.
    I loved hacking Roblox. Id go on daycare simulator games and make my own script to spawn in a shit ton of terrorist NPC's and clown cars.
    There was this spaceship game where I would make whole armies of bots to just mine stuff for me and fight too lol.
    But then I really started to like coding and got invested into it.
    Now i bought some parts off Alibaba and im gonna try to make my own SAP-1 build lol.
    I might look into this cus it sounds cheaper

    • @DrMattRegan
      @DrMattRegan  11 місяців тому +1

      Good luck with the build. I'm working towards a kit soon.

    • @honkhonk8009
      @honkhonk8009 11 місяців тому

      @@DrMattRegan That sounds sick. Il definitely look into it.
      One cancerous thing abt breadboarding up a computer though is definitely keeping the wires neat.
      Im honestly tempted to just use a perfboard and wire up everything with jumpers, and hide the cable monstrosity lmfao.
      I wish it was possible to use a 3D printer as a plotter and pump out good quality PCB's

  • @DavidLatham-productiondave
    @DavidLatham-productiondave Рік тому +2

    I'm confused. Why are there ducks in your pigeon holes?

  • @muhammadhabibahmadbscs-m2404

    Whelp

  • @Dont_Gnaw_on_the_Kitty
    @Dont_Gnaw_on_the_Kitty Рік тому

    The real genius of Turing was that he could only use relays, selectors and punched tape ie single element's, in his design of a working computer. Hiding the complexity of state machines in your eproms may not be a good teaching aid.

    • @DrMattRegan
      @DrMattRegan  Рік тому +1

      I guess “real genius” is like “real beauty “ - in the eye of the beholder. I think the real genius of Turing is that his description is largely agnostic to technology. The terms relay, selector and punched tape do not appear in his 1936 paper - but each to their own. He does refer to a paper tape, but this is somewhat idealised in that it is infinitely long and can be erased and written over an infinite number of times.
      As for hiding details in an eprom, have a look at the Turing6502 playlist starting at video 6 - plenty of detail about every state in the state machine.

  • @pdr0663
    @pdr0663 Рік тому

    A couple of small beefs... "Automata" is the plural of "Automaton". Your project contain one "Finite State Automaton". Please leave out audio like the samples you use for the tick and cross. They are very jarring. Loved the substance of your video, thanks.

    • @DrMattRegan
      @DrMattRegan  Рік тому

      Yes you are correct. I think i'll stick to finite state machine (can't afford an editor). Thanks for the feedback. Have you looked at the Turing6502 series?

    • @pdr0663
      @pdr0663 Рік тому

      @@DrMattRegan yes I have, wonderful series, thanks. I try to follow it all in real time but I go crosseyed before the end. Need to play and stop to absorb fully. I have "The Art of Digital Design" by Winkel and Prosser. I'd like to design my own PDP-8, but extend it from 12-bits to 16-bits for fun. They have the synthesis of a PDP-8 as an example in the text. They make use of multiplexers to create the finite state machine, but I like your approach of EEPROM + '374. It'll be a retirement project for me.

    • @DrMattRegan
      @DrMattRegan  Рік тому

      The EPROM + 374 makes a great state machine. Normally, each video should be about 1hr, but I compress it for youtube. Don't be afraid to watch them multiple times and ask questions.