Logic Design, Part 8
?
?

## Global Keys

W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

q Quotes r References f Filter y Link c Credits

a
w
s
d
h j k l

## Quotes, References and Credits Menus

o Open URL (in new tab)

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

z Toggle filter / linking mode

Enter Open URL (in new tab)
0:08Set the stage for the day covering dividers
🗩
0:08Set the stage for the day covering dividers
🗩
0:08Set the stage for the day covering dividers
🗩
1:48A quick note on the streaming schedule from Denmark
🗩
1:48A quick note on the streaming schedule from Denmark
🗩
1:48A quick note on the streaming schedule from Denmark
🗩
2:56Note our use of CPython, and consider switching to PyPy for improved performance
🗩
2:56Note our use of CPython, and consider switching to PyPy for improved performance
🗩
2:56Note our use of CPython, and consider switching to PyPy for improved performance
🗩
4:13Review our multipliers
📖
4:13Review our multipliers
📖
4:13Review our multipliers
📖
8:36Set up to cover dividers
🗩
8:36Set up to cover dividers
🗩
8:36Set up to cover dividers
🗩
10:26Integer division
🗩
10:26Integer division
🗩
10:26Integer division
🗩
13:45Euclidean algorithm (division by repeated subtraction)
🗩
13:45Euclidean algorithm (division by repeated subtraction)
🗩
13:45Euclidean algorithm (division by repeated subtraction)
🗩
17:17Long division (finish one digit of the quotient per iteration)
🗩
17:17Long division (finish one digit of the quotient per iteration)
🗩
17:17Long division (finish one digit of the quotient per iteration)
🗩
24:50Introduce euclidean_divide() as a software routine
24:50Introduce euclidean_divide() as a software routine
24:50Introduce euclidean_divide() as a software routine
25:59Introduce binary_divide() as a software routine
25:59Introduce binary_divide() as a software routine
25:59Introduce binary_divide() as a software routine
27:47Test euclidean_divide() to see that it works
🏃
27:47Test euclidean_divide() to see that it works
🏃
27:47Test euclidean_divide() to see that it works
🏃
29:14Test binary_divide() to see that it doesn't work
🏃
29:14Test binary_divide() to see that it doesn't work
🏃
29:14Test binary_divide() to see that it doesn't work
🏃
30:42Fix binary_divide() to left-shift the denominator by sum_bits - 1 before looping through the bits, right-shift the denominator at the end of each iteration of its loop, and preserve the original denominator for the assertion
30:42Fix binary_divide() to left-shift the denominator by sum_bits - 1 before looping through the bits, right-shift the denominator at the end of each iteration of its loop, and preserve the original denominator for the assertion
30:42Fix binary_divide() to left-shift the denominator by sum_bits - 1 before looping through the bits, right-shift the denominator at the end of each iteration of its loop, and preserve the original denominator for the assertion
34:21Run it to find that binary_divide() works
🏃
34:21Run it to find that binary_divide() works
🏃
34:21Run it to find that binary_divide() works
🏃
34:41Optimise binary_divide() as binary_divide2()
34:41Optimise binary_divide() as binary_divide2()
34:41Optimise binary_divide() as binary_divide2()
39:35Run it to see that the optimised binary_divide2() works, noting the possibility to put q and r in a single shift register
🏃
39:35Run it to see that the optimised binary_divide2() works, noting the possibility to put q and r in a single shift register
🏃
39:35Run it to see that the optimised binary_divide2() works, noting the possibility to put q and r in a single shift register
🏃
40:27Shift register
🗩
40:27Shift register
🗩
40:27Shift register
🗩
42:11Rename the divide functions to sw_*() and introduce our hardware binary_divider()
42:11Rename the divide functions to sw_*() and introduce our hardware binary_divider()
42:11Rename the divide functions to sw_*() and introduce our hardware binary_divider()
49:00Define Example36 as a divider
49:00Define Example36 as a divider
49:00Define Example36 as a divider
50:29Simulate our divider to see that it did not work
🏃
50:29Simulate our divider to see that it did not work
🏃
50:29Simulate our divider to see that it did not work
🏃
50:42Fix our divider simulator to pull the quotient out of the result, and trace binary_divider()
50:42Fix our divider simulator to pull the quotient out of the result, and trace binary_divider()
50:42Fix our divider simulator to pull the quotient out of the result, and trace binary_divider()
52:22Check out our trace of binary_divider()
🏃
52:22Check out our trace of binary_divider()
🏃
52:22Check out our trace of binary_divider()
🏃
53:03Fix binary_divider() to left-shift r
53:03Fix binary_divider() to left-shift r
53:03Fix binary_divider() to left-shift r
53:55Continue to scrutinise our binary_divider() trace to see that r wrapped around
🏃
53:55Continue to scrutinise our binary_divider() trace to see that r wrapped around
🏃
53:55Continue to scrutinise our binary_divider() trace to see that r wrapped around
🏃
56:42 How will we handle floating point numbers?
🗪
56:42 How will we handle floating point numbers?
🗪
56:42 How will we handle floating point numbers?
🗪
56:54Scrutinise our binary_divider() trace now including d2
🏃
56:54Scrutinise our binary_divider() trace now including d2
🏃
56:54Scrutinise our binary_divider() trace now including d2
🏃
59:01Fix binary_divider() to left-shift d2 by len(d) - 1
59:01Fix binary_divider() to left-shift d2 by len(d) - 1
59:01Fix binary_divider() to left-shift d2 by len(d) - 1
1:00:19Trace q and r at both the start and end of the loop in binary_divider()
1:00:19Trace q and r at both the start and end of the loop in binary_divider()
1:00:19Trace q and r at both the start and end of the loop in binary_divider()
1:00:35Check our binary_divider() trace to see "post r" of 240
🏃
1:00:35Check our binary_divider() trace to see "post r" of 240
🏃
1:00:35Check our binary_divider() trace to see "post r" of 240
🏃
1:02:03Print the generated code of Example36's binary_divider()
1:02:03Print the generated code of Example36's binary_divider()
1:02:03Print the generated code of Example36's binary_divider()
1:02:39Check the code of Example36
📖
1:02:39Check the code of Example36
📖
1:02:39Check the code of Example36
📖
1:04:59Distinguish unary and binary minus in the compiler
1:04:59Distinguish unary and binary minus in the compiler
1:04:59Distinguish unary and binary minus in the compiler
1:07:25Check the newly generated code of Example36's binary_divider()
📖
1:07:25Check the newly generated code of Example36's binary_divider()
📖
1:07:25Check the newly generated code of Example36's binary_divider()
📖
1:10:06Remove the test unary minus from binary_divider() and simulate it to see that it works
🏃
1:10:06Remove the test unary minus from binary_divider() and simulate it to see that it works
🏃
1:10:06Remove the test unary minus from binary_divider() and simulate it to see that it works
🏃
1:10:39Slightly rewrite binary_divider()
1:10:39Slightly rewrite binary_divider()
1:10:39Slightly rewrite binary_divider()
1:12:08Reflect of our restoring division, with thoughts on possible optimisations
🗩
1:12:08Reflect of our restoring division, with thoughts on possible optimisations
🗩
1:12:08Reflect of our restoring division, with thoughts on possible optimisations
🗩
1:14:04Optimise binary_divider() as binary_divider2()
1:14:04Optimise binary_divider() as binary_divider2()
1:14:04Optimise binary_divider() as binary_divider2()
1:18:01Simulate binary_divider2() to see that it works
🏃
1:18:01Simulate binary_divider2() to see that it works
🏃
1:18:01Simulate binary_divider2() to see that it works
🏃
1:18:23Understanding the need to 0-extend the difference of a subtraction in order to derive its sign
🗩
1:18:23Understanding the need to 0-extend the difference of a subtraction in order to derive its sign
🗩
1:18:23Understanding the need to 0-extend the difference of a subtraction in order to derive its sign
🗩
1:19:14Restoring division1
📖
1:19:14Restoring division1
📖
1:19:14Restoring division1
📖
1:20:45Introduce nonrestoring_binary_divider()2
1:20:45Introduce nonrestoring_binary_divider()2
1:20:45Introduce nonrestoring_binary_divider()2
1:27:09Simulate nonrestoring_binary_divider() and fail the test
🏃
1:27:09Simulate nonrestoring_binary_divider() and fail the test
🏃
1:27:09Simulate nonrestoring_binary_divider() and fail the test
🏃
1:28:55Fix nonrestoring_binary_divider() to mux between the correct q, before tracing it
1:28:55Fix nonrestoring_binary_divider() to mux between the correct q, before tracing it
1:28:55Fix nonrestoring_binary_divider() to mux between the correct q, before tracing it
1:30:58Check out the trace of nonrestoring_binary_divider()
🏃
1:30:58Check out the trace of nonrestoring_binary_divider()
🏃
1:30:58Check out the trace of nonrestoring_binary_divider()
🏃
1:32:43Work through non-restoring division from first principles3
🗩
1:32:43Work through non-restoring division from first principles3
🗩
1:32:43Work through non-restoring division from first principles3
🗩
1:35:28Enable nonrestoring_binary_divider() to fix up q and r if the remainder is negative4
1:35:28Enable nonrestoring_binary_divider() to fix up q and r if the remainder is negative4
1:35:28Enable nonrestoring_binary_divider() to fix up q and r if the remainder is negative4
1:44:47Trace nonrestoring_binary_divider()
🏃
🖮
1:44:47Trace nonrestoring_binary_divider()
🏃
🖮
1:44:47Trace nonrestoring_binary_divider()
🏃
🖮
1:46:27Introduce convert_signed() for the tracing code to use
1:46:27Introduce convert_signed() for the tracing code to use
1:46:27Introduce convert_signed() for the tracing code to use
1:51:27Enable signed in the nonrestoring_binary_divider() tracing
1:51:27Enable signed in the nonrestoring_binary_divider() tracing
1:51:27Enable signed in the nonrestoring_binary_divider() tracing
1:51:53Scrutinise the trace of nonrestoring_binary_divider() to determine that the arithmetic right-shift is misbehaving
🏃
1:51:53Scrutinise the trace of nonrestoring_binary_divider() to determine that the arithmetic right-shift is misbehaving
🏃
1:51:53Scrutinise the trace of nonrestoring_binary_divider() to determine that the arithmetic right-shift is misbehaving
🏃
1:53:22Enable nonrestoring_binary_divider() to perform arithmetic right-shift where necessary
1:53:22Enable nonrestoring_binary_divider() to perform arithmetic right-shift where necessary
1:53:22Enable nonrestoring_binary_divider() to perform arithmetic right-shift where necessary
1:53:38Simulate nonrestoring_binary_divider() and still fail the test
🏃
1:53:38Simulate nonrestoring_binary_divider() and still fail the test
🏃
1:53:38Simulate nonrestoring_binary_divider() and still fail the test
🏃
1:54:59Fix nonrestoring_binary_divider() to shift r in the correct direction (i.e. left)
1:54:59Fix nonrestoring_binary_divider() to shift r in the correct direction (i.e. left)
1:54:59Fix nonrestoring_binary_divider() to shift r in the correct direction (i.e. left)
1:56:23Simulate nonrestoring_binary_divider(), fail the test and consult the trace5
🏃
1:56:23Simulate nonrestoring_binary_divider(), fail the test and consult the trace5
🏃
1:56:23Simulate nonrestoring_binary_divider(), fail the test and consult the trace5
🏃
2:02:37Change nonrestoring_binary_divider() to pre-shift r
2:02:37Change nonrestoring_binary_divider() to pre-shift r
2:02:37Change nonrestoring_binary_divider() to pre-shift r
2:02:55Simulate nonrestoring_binary_divider() and still fail the test
🏃
2:02:55Simulate nonrestoring_binary_divider() and still fail the test
🏃
2:02:55Simulate nonrestoring_binary_divider() and still fail the test
🏃