The Sieve of Eratosthenes

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

ความคิดเห็น • 50

  • @TroySchrapel
    @TroySchrapel 2 ปีที่แล้ว +13

    Great to see you back, James. 🙂

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว +2

      Thanks Troy, hope it was interesting.

  • @djc1402
    @djc1402 2 ปีที่แล้ว +2

    Welcome back, I've been missing your videos. I'll have a go at the segmented sieve on my CPU, I've only implemented calculating primes up to 255 at the moment.

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว

      Good luck David. The segmented sieve is idea for implementing on the kind of cpu's we are building. Hope you enjoy the process!

  • @hujkin1684
    @hujkin1684 2 ปีที่แล้ว

    Wonderful video, glad to see you back James!

  • @peter.stimpel
    @peter.stimpel 2 ปีที่แล้ว

    I like such stuff. It recalls good memories of my childhood in the 80s, my first steps with GDR 8bit CPUs. Basic, assembler and pascal. Please, more of it!

  • @m1geo
    @m1geo 2 ปีที่แล้ว

    Yay! He's back!

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว +1

      Thanks George. I was never really gone, but the next video will not be as long a wait (I hope!)

    • @m1geo
      @m1geo 2 ปีที่แล้ว

      @@weirdboyjim Excellent! Keep them coming! 👏

  • @Dave5281968
    @Dave5281968 2 ปีที่แล้ว

    As usual you've given an excellent description of the task, and an excellent description of how it's done without having to fill the entire address space with one array. A video going over the how-to in assembly would be nice to see, but it would probably be even better if it was a side-by-side video with both assembly and C implementations. (I say this because modern RISC CPU's, especially ARM and MIPS, have instruction sets that were designed to be used with a C/C++ compiler and genuinely are extremely difficult to hand code in assembly with as efficient a result as even the free GCC compiler.) Thanks alot for the video. Always great to watch your videos.

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว

      I've been having a think about a programming video for it. I'd be more inclined to do c/c++ just to make it a bit more accessible.

    • @ronbasque1206
      @ronbasque1206 2 ปีที่แล้ว

      @@weirdboyjim Thanks for this video, I was one who had asked for this. I agree that a bit of a code walk through would be interesting. Maybe more detailed in c/c++ with a brief comparison to your assembler implementation. I've seen a few videos implemented in python on processors w/ gigabytes of work space, but would love to see how to fit it into an 8-bit environment. That's the unique aspect. cheers

  • @duality4y
    @duality4y 2 ปีที่แล้ว

    I really love how you have grown being on camera :)

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว

      Thanks, my early videos are really a bit cringe now.

  • @ryanb8302
    @ryanb8302 2 ปีที่แล้ว

    Very nice video!

  • @LeoBerardino
    @LeoBerardino 2 ปีที่แล้ว +1

    Hey James, great video.
    Is the CPU finished?

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว +5

      The core Cpu is "mostly finished" but there will still be a bunch of videos on VGA, Audio and some additional peripherals.

  • @yngsjo
    @yngsjo 2 ปีที่แล้ว +2

    Wonderful description. An example of code in C or something similar would be fun to se.

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว +1

      Are you thinking a quick tour or a code along video? Be nice if youtube supported quick video comments.

    • @yngsjo
      @yngsjo 2 ปีที่แล้ว

      @@weirdboyjim some code assembly or c. I think c is better for a majority of people to read and understand

    • @GORF_EMPIRE
      @GORF_EMPIRE 2 ปีที่แล้ว +2

      @@yngsjo Id' prefer assembly just so we can bring back a lost art. Too many people today rely way too much on high level languages and have not experienced the pedal to the metal joy of asm.

    • @darer13
      @darer13 2 ปีที่แล้ว

      @@GORF_EMPIRE for 6502 or similar complexity, then yes. none of those x86 or arm... or avr. no thanks

    • @yngsjo
      @yngsjo 2 ปีที่แล้ว

      @@GORF_EMPIRE problem with assembly in my experience is the difference between sets of operations in cpu.
      We still use Ericsson Apn 586 computers. There is maybe two persons in Sweden who still know how to program these in assembly... 😕

  • @ArtisanASCII
    @ArtisanASCII 2 ปีที่แล้ว +1

    Are there going to be any more computer videos?

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว +5

      Of course, there are several in progress.

  • @gregvandenberg2859
    @gregvandenberg2859 2 ปีที่แล้ว

    I would be very interested in seeing a 32 bit implementation of this on your cpu. I assume since you have done this to 16 bits on an 8 bit system, it could be done. Would it be a memory restriction? If so, how about 24 bits?

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว

      The two big memory costs are the main sieve table, and the list of primes in the first segment. For a 32bit sieve your segment would be 64k entries but you can halve that (By ignoring even numbers) and then pack it into bits to make the table 4k. The primes table though would be 32bits per entry, that would be around 26k of data. So yes, you could do it although 24bits would be a bit more comfortable.

  • @kayezero703
    @kayezero703 2 ปีที่แล้ว +1

    That is nice

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว +1

      Thanks Kaye!

    • @kayezero703
      @kayezero703 2 ปีที่แล้ว

      @@weirdboyjim
      You are welcome and I'll be always here to support you ❤

  • @zach-18082
    @zach-18082 2 ปีที่แล้ว

    Hello, I am a teenager interested in all of these types of things. I have a ben eater kit, but I want to build and design an 8bit computer completely from scratch. Where did you learn all of this stuff, books, tutorials, etc. Any recommendations?

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว

      I'm a programmer for my job, but lots of low level performance stuff so I picked up lots of computer architecture bits over the years. More recently I added just enough electronics knowledge to start building.

    • @zach-18082
      @zach-18082 2 ปีที่แล้ว

      @@weirdboyjim cool. i have a bunch of books i’m trying to go through, but the pipelined cpu series is great a big help. 😀

  • @TheEmbeddedHobbyist
    @TheEmbeddedHobbyist 2 ปีที่แล้ว

    Can we use the colander of Archimedes as I believe his friend and colleague was also looking in to area of mathematics at the time, but Eratosthenes beat him to it and as we know history never remembers the name of the person who came second. ;-)

    • @weirdboyjim
      @weirdboyjim  2 ปีที่แล้ว

      Ahh, you see there is a debate on whether Eratosthenes invented or merely popularized this algorithm I was careful to use the phrase "Attributed to" rather than "Invented by" to try and keep myself clear of the controversy. That said I mentioned him by name so the flat earthers are probably coming for me anyway.

    • @TheEmbeddedHobbyist
      @TheEmbeddedHobbyist 2 ปีที่แล้ว

      @@weirdboyjim Well I expect now you have upset Flat earthers all around the globe. :-)

  • @twobob
    @twobob 2 ปีที่แล้ว

    :) Joy

  • @christopherellis2663
    @christopherellis2663 ปีที่แล้ว

    Rather, . Any number ab is not prime, including a=b, except where a or b equal 1.

    • @weirdboyjim
      @weirdboyjim  ปีที่แล้ว

      That definition would only be valid if you specify that both a and b must be natural numbers.