Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Relay Computer Pi - Ep6 - Going to great lengths

Автор: Paul Law

Загружено: 2025-03-21

Просмотров: 705

Описание:

I'm working towards my electromechanical relay computer calculating Pi to 20 digits ... and now my computer is Turing complete I can tackle the long addition and subtraction routines.

If you'd like to play with the code shown in this episode you can use https://editor.relaycomputer.co.uk and load the long addition and subtraction examples from the import menu.

Chapters:
00:00 Introduction & series recap
01:28 Long Addition: Assembly
11:02 Long Addition: Emulator
12:56 Long Addition: Loading code
14:55 Long Addition: Demo
18:26 Long Addition: Result
19:09 Long Subtraction: Assembly
21:54 Long Subtraction: Demo
24:40 Long Subtraction: Result
25:16 What's Next

If you'd like an overview of my Relay Computer then this is a good place to start:    • Relay Computer 2020 Review: Architecture   and more information on my relay computer can be found here on my YouTube channel and on my blog at https://relaycomputer.co.uk

In this episode:

Now that my relay computer is Turing complete (and I can store and load values in memory) it's time to tackle the long addition and subtraction routines which are a key part of the pseudo code required to calculate Pi (via the Bailey–Borwein–Plouffe formula).

I've already covered an approach for long addition in Episode 4 so this time I go straight into writing the assembly language code. I spend quite a bit of time on this in the video as I'm writing in my custom assembly language that's kind of a combination of what you might see in x86, z80 and 6502 assemblers. Everything you see though is available at https://editor.relaycomputer.co.uk and there's some documentation too there if you'd like to play along or try out the long addition in my emulator.

Something that's rapidly becoming a challenge though is that as the code for calculating Pi becomes more and more complete the length of the programs are getting longer and longer. That in itself isn't a problem until you come to entering the program, line at a time - by hand, in to the relay computer. Eventually I'll create an optical paper tape reader that will make loading programs a breeze but in the meanwhile I've gone with a temporary Arduino & relay board approach to get my programs loaded.

With the program loaded I'm then able to demonstrate the long addition routine running. This time I'm using the crystal clock set to 4Hz (instead of the 6Hz fixed speed relay clock) so you can see a bit more of the computer 'doing its thing'. At the end I show the result of the addition and that it achieved the same result as the emulator did.

Given long subtraction isn't a whole lot different to long addition I squeeze writing that in to this episode too. This time I start with the completed code and just run through where the differences are compared with long addition. Performing binary subtraction is usually done by calculating a two's complement of the second value and then adding the values together. To make the code run a little more efficiently I add one to the result first which means then I only need to calculate a one's complement (i.e. a logical NOT) to each byte of the value.

With the long subtraction written I can then get on with demoing it on the relay computer. This time I run the crystal clock at 8Hz to get the overall program run time down. In this case 8Hz means 16CPS (cycles per second) and that means you can run two 8 cycle operations per second (for example, ALU, SETAB and 8-bit MOVES are all 8 cycle). At the end I quickly compare the result to what's expected and with that we've got long addition and subtraction in the bag.

This all means that the next thing to tackle is long division and, to be fair, this is the one I've not been looking forward to. There's no way around it though - long division is crucial to calculating Pi with the BBP formula so next episode I'll be getting stuck in to it.

Relay Computer Pi - Ep6 - Going to great lengths

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Relay Computer Pi - Ep7 - The 'divisive' one

Relay Computer Pi - Ep7 - The 'divisive' one

Relay Computer Pi - Ep7.5 - Moar division

Relay Computer Pi - Ep7.5 - Moar division

Relay Computer Pi - Ep1 - Where to start?

Relay Computer Pi - Ep1 - Where to start?

Relay Computer Pi - Ep5 - Going full Turing

Relay Computer Pi - Ep5 - Going full Turing

ESP32: распознавание речи нейросетью (TensorFlow Lite)

ESP32: распознавание речи нейросетью (TensorFlow Lite)

Светодиодные конденсаторы? Посмотрите, как они работают!

Светодиодные конденсаторы? Посмотрите, как они работают!

Зачем подключать конденсатор параллельно диоду? Вот почему!

Зачем подключать конденсатор параллельно диоду? Вот почему!

Как загружается Linux

Как загружается Linux

Что такое

Что такое "Reverse Engineering". Показываю как ломают софт.

Китай на грани... И вот что он делает

Китай на грани... И вот что он делает

15 трлн. дефицита бюджета или остановка промышленности. Что добьет страну? Дебаты, часть 2

15 трлн. дефицита бюджета или остановка промышленности. Что добьет страну? Дебаты, часть 2

Каково это — изобретать математику?

Каково это — изобретать математику?

Структура файлов и каталогов в Linux

Структура файлов и каталогов в Linux

Relay Computer Pi - Ep8 - Pi's quite enough

Relay Computer Pi - Ep8 - Pi's quite enough

Relay Computer Pi - Ep4 - Binary Breakdown

Relay Computer Pi - Ep4 - Binary Breakdown

Tektronix  TDS8000 Часть 1.

Tektronix TDS8000 Часть 1.

Обновлять или не Обновлять Windows? Все ЗА и ПРОТИВ!

Обновлять или не Обновлять Windows? Все ЗА и ПРОТИВ!

Преломление и «замедление» света | По мотивам лекции Ричарда Фейнмана

Преломление и «замедление» света | По мотивам лекции Ричарда Фейнмана

Relay Computer Clock - Ep15 - Construction & Testing

Relay Computer Clock - Ep15 - Construction & Testing

⚡️ Командный пункт ВСУ захвачен || Военный переворот в Украине?

⚡️ Командный пункт ВСУ захвачен || Военный переворот в Украине?

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]