filmov
tv
Euclid's algorithm executed on the relay computer

Показать описание
Register block is the second from the right.
There are A, B on top and PC on bottom.
The following program is executed with op1=15, op2=12:
; A, B - operands, A - result
ORG 0
MOVI A, op1 ; 00: 10000000 iiiiiiii
MOVI B, op2 ; 01: 10000001 iiiiiiii
LOOP:
OR F, A, A ; 02: 01101000 00000000
JMP Z, END ; 03: 10010111 00001100
OR F, B, B ; 04: 01101000 00010001
JMP Z, END ; 05: 10010111 00001100
SUB F, A, B ; 06: 01011000 00000001
JMP C, L1 ; 07: 10110111 00001010
SUB A, A, B ; 08: 01011000 00001001
JMP LOOP ; 09: 10000111 00000010
L1:
SUB B, B, A ; 0A: 01011001 00011000
JMP LOOP ; 0B: 10000111 00000010
END:
ADD A, A, B ; 0C: 01001000 00001001
HALT ; 0D: 00010000 00000000
There are A, B on top and PC on bottom.
The following program is executed with op1=15, op2=12:
; A, B - operands, A - result
ORG 0
MOVI A, op1 ; 00: 10000000 iiiiiiii
MOVI B, op2 ; 01: 10000001 iiiiiiii
LOOP:
OR F, A, A ; 02: 01101000 00000000
JMP Z, END ; 03: 10010111 00001100
OR F, B, B ; 04: 01101000 00010001
JMP Z, END ; 05: 10010111 00001100
SUB F, A, B ; 06: 01011000 00000001
JMP C, L1 ; 07: 10110111 00001010
SUB A, A, B ; 08: 01011000 00001001
JMP LOOP ; 09: 10000111 00000010
L1:
SUB B, B, A ; 0A: 01011001 00011000
JMP LOOP ; 0B: 10000111 00000010
END:
ADD A, A, B ; 0C: 01001000 00001001
HALT ; 0D: 00010000 00000000
How Does Euclid’s Algorithm Give HCF? | Euclid's Algorithm To Find HCF | BYJU'S Maths
How to Find the Greatest Common Divisor by Using the Euclidian Algorithm
The Extended Euclidean algorithm
Finding The Greatest Common Divisor Using The Euclidean Algorithm
euclid s algorithm in java
GCD - Euclidean Algorithm (Method 1)
Euclid Division Algorithm Find HCF of 135 & 225 #shorts
euclid s algorithm in java
Extended Euclidean Algorithm Example
euclid s algorithm gcd java
C# Recursion Programming Euclid's Algorithm for Greatest Common Divisor GCD
An Example of GCD, and Extended Euclidean Algorithm In Finding the Bezout Coefficients
Extended Euclidean Algorithm to Solve Linear Diophantine Equation
436.Mathematics - Euclid's Division Algorithm - Practical application
Euclidean Algorithm [GCD] Code in Python
How to: Euclidean Algorithm in JavaScript
Who was Euclid mathematician |biography|Euclid maths #shorts #short #euclidsalgorithm
Lecture 7 Part 5 : Euclid's algorithm for GCD
The Extended Euclidean Algorithm to Find GCD
Math 320, Polynomial Euclidean Algorithm
Understanding the Extended Euclidean Algorithm: A Deep Dive into Implementation and Meaning
Mathematics - Finding HCF using Euclid's Division Algorithm
Maths for DSA - One Shot | Euclid's Algorithm | Sieve of Eratosthenes | Modular Arithmetics
Intro to Proofs - Number Theory - Euclidean GCD Algorithm
Комментарии