Logic Design, Part 6

?

?# Keyboard Navigation

## Global Keys

[, < / ], > Jump to previous / next episode

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)## Menu toggling

q Quotes
r References
f Filter
y Link
c Credits
## In-Menu Movement

## Quotes and References Menus

Enter Jump to timecode

## Quotes, References and Credits Menus

o Open URL (in new tab)
## Filter Menu

x, Space Toggle category and focus next

X, ShiftSpace Toggle category and focus previous

v Invert topics / media as per focus## Filter and Link Menus

z Toggle filter / linking mode
## Credits Menu

Enter Open URL (in new tab)

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)

a

w

s

s

d

h
j
k
l

←

↑

↓

↓

→

X, ShiftSpace Toggle category and focus previous

v Invert topics / media as per focus

⏫

Previous: 'Logic Design, Part 5'

⏫

0:06Recap and set the stage for the day revisiting ALU before going on to shifters

🗩

0:06Recap and set the stage for the day revisiting ALU before going on to shifters

🗩

0:06Recap and set the stage for the day revisiting ALU before going on to shifters

🗩

1:18Review our adders

📖

1:18Review our adders

📖

1:18Review our adders

📖

2:37Review off-stream introduction of Kogge Stone scan

📖

2:37Review off-stream introduction of Kogge Stone scan

📖

2:37Review off-stream introduction of Kogge Stone scan

📖

4:23Review off-stream introduction of analyze_delay()

📖

4:23Review off-stream introduction of analyze_delay()

📖

4:23Review off-stream introduction of analyze_delay()

📖

8:04Instantiate 32-bit and 4-bit bit adders to compare their delay with the 64-bit ones

🏃

8:04Instantiate 32-bit and 4-bit bit adders to compare their delay with the 64-bit ones

🏃

8:04Instantiate 32-bit and 4-bit bit adders to compare their delay with the 64-bit ones

🏃

9:57Shifters

🗩

9:57Shifters

🗩

9:57Shifters

🗩

12:23Set up to implement dynamic shift in terms of static shift

🗩

12:23Set up to implement dynamic shift in terms of static shift

🗩

12:23Set up to implement dynamic shift in terms of static shift

🗩

13:42Introduce left_shifter()

13:42Introduce left_shifter()

13:42Introduce left_shifter()

16:50Define Example16 as a left shifter module

16:50Define Example16 as a left shifter module

16:50Define Example16 as a left shifter module

18:47Check out our left shifter graph

🏃

18:47Check out our left shifter graph

🏃

18:47Check out our left shifter graph

🏃

19:21Instantiate a 16-bit shifter and check out its graph

🏃

19:21Instantiate a 16-bit shifter and check out its graph

🏃

19:21Instantiate a 16-bit shifter and check out its graph

🏃

20:43Define Mux4 module

20:43Define Mux4 module

20:43Define Mux4 module

22:43Introduce left_shifter_radix2() and left_shifter_radix4() based on our original left_shifter()

22:43Introduce left_shifter_radix2() and left_shifter_radix4() based on our original left_shifter()

22:43Introduce left_shifter_radix2() and left_shifter_radix4() based on our original left_shifter()

25:25Define Example17 using left_shifter_radix4()

25:25Define Example17 using left_shifter_radix4()

25:25Define Example17 using left_shifter_radix4()

25:48Check out the graph to find that left_shifter_radix4() does not work

🏃

25:48Check out the graph to find that left_shifter_radix4() does not work

🏃

25:48Check out the graph to find that left_shifter_radix4() does not work

🏃

27:18Redefine Example17 using just mux4()

27:18Redefine Example17 using just mux4()

27:18Redefine Example17 using just mux4()

27:48Check out the mux4 graph to see that that works

🏃

27:48Check out the mux4 graph to see that that works

🏃

27:48Check out the mux4 graph to see that that works

🏃

28:00Fix left_shifter_radix4() to loop over the correct range

28:00Fix left_shifter_radix4() to loop over the correct range

28:00Fix left_shifter_radix4() to loop over the correct range

28:43Check out the left_shifter_radix4() graph

🏃

28:43Check out the left_shifter_radix4() graph

🏃

28:43Check out the left_shifter_radix4() graph

🏃

29:38Instantiate a 32-bit shifter, and enable left_shifter_radix4() to handle odd-numbered shift bits

29:38Instantiate a 32-bit shifter, and enable left_shifter_radix4() to handle odd-numbered shift bits

31:01Check out the graph to see that it is not as expected

🏃

31:01Check out the graph to see that it is not as expected

🏃

31:01Check out the graph to see that it is not as expected

🏃

31:22Change left_shifter_radix4() to handle odd-numbered shift bits inside its loop

31:22Change left_shifter_radix4() to handle odd-numbered shift bits inside its loop

31:22Change left_shifter_radix4() to handle odd-numbered shift bits inside its loop

32:00Check out the graph of our 32-bit left shifter

🏃

32:00Check out the graph of our 32-bit left shifter

🏃

32:00Check out the graph of our 32-bit left shifter

🏃

32:32Reflect on our single logarithmic shifter, with a brief mention of linear shifters

🗩

32:32Reflect on our single logarithmic shifter, with a brief mention of linear shifters

🗩

32:32Reflect on our single logarithmic shifter, with a brief mention of linear shifters

🗩

33:44Right-shifting, both logical and arithmetic

🗩

33:44Right-shifting, both logical and arithmetic

🗩

33:44Right-shifting, both logical and arithmetic

🗩

35:27Q&A

🗩

35:27Q&A

🗩

35:27Q&A

🗩

36:16Recommend Mean and Conway's 'Introduction to VLSI systems'^{1}

📖

36:16Recommend Mean and Conway's 'Introduction to VLSI systems'^{1}

📖

36:16Recommend Mean and Conway's 'Introduction to VLSI systems'^{1}

📖

37:37Introduce rotator_radix2

37:37Introduce rotator_radix2

37:37Introduce rotator_radix2

39:41Define Example18 as a left-rotator

39:41Define Example18 as a left-rotator

39:41Define Example18 as a left-rotator

40:09Instantiate a 16-bit left-rotator and check out its graph

🏃

40:09Instantiate a 16-bit left-rotator and check out its graph

🏃

40:09Instantiate a 16-bit left-rotator and check out its graph

🏃

41:10Rename rotator_radix2() to left_rotator_radix2() and introduce right_rotator_radix2() using it

41:10Rename rotator_radix2() to left_rotator_radix2() and introduce right_rotator_radix2() using it

41:10Rename rotator_radix2() to left_rotator_radix2() and introduce right_rotator_radix2() using it

44:15Introduce __neg__() – unary minus operator – in rattle

44:15Introduce __neg__() – unary minus operator – in rattle

44:15Introduce __neg__() – unary minus operator – in rattle

45:36Check out our right-rotator graph

🏃

45:36Check out our right-rotator graph

🏃

45:36Check out our right-rotator graph

🏃

46:42Introduce the notion of pre-rotation in right_rotator_radix2()

46:42Introduce the notion of pre-rotation in right_rotator_radix2()

46:42Introduce the notion of pre-rotation in right_rotator_radix2()

48:25Check out our pre-rotated right rotator graph

🏃

48:25Check out our pre-rotated right rotator graph

🏃

48:25Check out our pre-rotated right rotator graph

🏃

48:32Test our shifters in the simulator

🏃

48:32Test our shifters in the simulator

🏃

48:32Test our shifters in the simulator

🏃

50:38Test our rotators in the simulator, introducing rotl() and rotr()

🏃

50:38Test our rotators in the simulator, introducing rotl() and rotr()

🏃

50:38Test our rotators in the simulator, introducing rotl() and rotr()

🏃

53:37All the tests passed at the first try

🗩

53:37All the tests passed at the first try

🗩

53:37All the tests passed at the first try

🗩

54:47Enable rotl() and rotr() to work with signed values

54:47Enable rotl() and rotr() to work with signed values

54:47Enable rotl() and rotr() to work with signed values

55:02Set up to create our first combined design: Barrel shifter

🗩

55:02Set up to create our first combined design: Barrel shifter

🗩

55:02Set up to create our first combined design: Barrel shifter

🗩

56:32Introduce barrel_left_shifter()

56:32Introduce barrel_left_shifter()

56:32Introduce barrel_left_shifter()

59:54Define Example20 as a left barrel shifter

59:54Define Example20 as a left barrel shifter

59:54Define Example20 as a left barrel shifter

1:00:37Simulate the left barrel shifter and fail the verification test

🏃

1:00:37Simulate the left barrel shifter and fail the verification test

🏃

1:00:37Simulate the left barrel shifter and fail the verification test

🏃

1:01:22Fix missing comma in binary_ops

1:01:22Fix missing comma in binary_ops

1:01:22Fix missing comma in binary_ops

1:01:48Test the correct module in Example20, and simulate it to find that it passes

🏃

1:01:48Test the correct module in Example20, and simulate it to find that it passes

🏃

1:01:48Test the correct module in Example20, and simulate it to find that it passes

🏃

1:02:33Introduce barrel_right_shifter()

1:02:33Introduce barrel_right_shifter()

1:02:33Introduce barrel_right_shifter()

1:05:15Explain inference of literal types

🗩

1:05:15Explain inference of literal types

🗩

1:05:15Explain inference of literal types

🗩

1:06:04Define Example21 as a right barrel shifter

1:06:04Define Example21 as a right barrel shifter

1:06:04Define Example21 as a right barrel shifter

1:06:32Simulate the right barrel shifter, fail the test and investigate why

🏃

1:06:32Simulate the right barrel shifter, fail the test and investigate why

🏃

1:06:32Simulate the right barrel shifter, fail the test and investigate why

🏃

1:15:04Print the mask of barrel_right_shifter()

1:15:04Print the mask of barrel_right_shifter()

1:15:04Print the mask of barrel_right_shifter()

1:16:13Run it and check out the mask

🏃

1:16:13Run it and check out the mask

🏃

1:16:13Run it and check out the mask

🏃

1:16:56Fix the mask computation in barrel_right_shifter()

1:16:56Fix the mask computation in barrel_right_shifter()

1:16:56Fix the mask computation in barrel_right_shifter()

1:17:11Simulate the right barrel shifter and pass the test

🏃

1:17:11Simulate the right barrel shifter and pass the test

🏃

1:17:11Simulate the right barrel shifter and pass the test

🏃

1:17:19Remove the mask printout

1:17:19Remove the mask printout

1:17:19Remove the mask printout

1:18:11Simulate it, pass the test and reflect on the right barrel shifter

🏃

1:18:11Simulate it, pass the test and reflect on the right barrel shifter

🏃

1:18:11Simulate it, pass the test and reflect on the right barrel shifter

🏃

1:19:06Introduce barrel_arithmetic_right_shifter()

1:19:06Introduce barrel_arithmetic_right_shifter()

1:19:06Introduce barrel_arithmetic_right_shifter()

1:22:32Enable barrel_arithmetic_right_shifter() to mux between clearing and setting the upper bits

1:22:32Enable barrel_arithmetic_right_shifter() to mux between clearing and setting the upper bits

1:22:32Enable barrel_arithmetic_right_shifter() to mux between clearing and setting the upper bits

1:24:54Simulate the barrel_arithmetic_right_shifter() on a signed input to find that it works

🏃

1:24:54Simulate the barrel_arithmetic_right_shifter() on a signed input to find that it works

🏃

1:24:54Simulate the barrel_arithmetic_right_shifter() on a signed input to find that it works

🏃

1:25:04Introduce barrel_shifter() as our first combined design

1:25:04Introduce barrel_shifter() as our first combined design

1:25:04Introduce barrel_shifter() as our first combined design

1:35:34Define Example23 as a unified barrel shifter

1:35:34Define Example23 as a unified barrel shifter

1:35:34Define Example23 as a unified barrel shifter

1:37:26Simulate our unified barrel shifter on left- and right-rotations and left-shift, to find that they all work

🏃

🖮

1:37:26Simulate our unified barrel shifter on left- and right-rotations and left-shift, to find that they all work

🏃

🖮

🏃

🖮

1:40:06Simulate right-shift to find that it doesn't work, and investigate why

🏃

1:40:06Simulate right-shift to find that it doesn't work, and investigate why

🏃

1:40:06Simulate right-shift to find that it doesn't work, and investigate why

🏃

1:42:00Print the mask of barrel_shifter()

1:42:00Print the mask of barrel_shifter()

1:42:00Print the mask of barrel_shifter()

1:43:05Enable barrel_shifter() to correctly perform right-shift

1:43:05Enable barrel_shifter() to correctly perform right-shift

1:43:05Enable barrel_shifter() to correctly perform right-shift

1:43:44Simulate the barrel shifter on right-shift, and pass the test

🏃

1:43:44Simulate the barrel shifter on right-shift, and pass the test

🏃

1:43:44Simulate the barrel shifter on right-shift, and pass the test

🏃

1:44:05Simulate the barrel shifter on arithmetic shift, and pass

🏃

1:44:05Simulate the barrel shifter on arithmetic shift, and pass

🏃

1:44:05Simulate the barrel shifter on arithmetic shift, and pass

🏃

1:44:48Change barrel_shifter() to force the mask to all 1s and delete the output mux in the rotate case

1:44:48Change barrel_shifter() to force the mask to all 1s and delete the output mux in the rotate case

1:45:46Simulate it to find that it works

🏃

1:45:46Simulate it to find that it works

🏃

1:45:46Simulate it to find that it works

🏃

1:46:09Introduce left_rotator_radix4()

1:46:09Introduce left_rotator_radix4()

1:46:09Introduce left_rotator_radix4()

1:50:03Check out the left_rotator_radix4 graph to see that it looks reasonable

🏃

1:50:03Check out the left_rotator_radix4 graph to see that it looks reasonable

🏃

1:50:03Check out the left_rotator_radix4 graph to see that it looks reasonable

🏃

1:50:33Instantiate an 8-bit rotator and check out its graph

🏃

1:50:33Instantiate an 8-bit rotator and check out its graph

🏃

1:50:33Instantiate an 8-bit rotator and check out its graph

🏃

1:52:10Test barrel_shifter() using both left_rotator_radix2() and left_rotator_radix4() to see that it works

🏃

🖮

1:52:10Test barrel_shifter() using both left_rotator_radix2() and left_rotator_radix4() to see that it works

🏃

🖮

🏃

🖮

1:53:03Check out the graph of our unified barrel shifter

🏃

1:53:03Check out the graph of our unified barrel shifter

🏃

1:53:03Check out the graph of our unified barrel shifter

🏃

1:53:26Rewrite left_rotator_radix4() as per rygorous's suggestion

1:53:26Rewrite left_rotator_radix4() as per rygorous's suggestion

1:53:26Rewrite left_rotator_radix4() as per rygorous's suggestion

1:53:55Consult the graph of our unified barrel shifter

🏃

1:53:55Consult the graph of our unified barrel shifter

🏃

1:53:55Consult the graph of our unified barrel shifter

🏃

1:54:34Instantiate a 16-bit barrel shifter and check out its graph, noting the importance of the mask being off the critical path

🏃

1:54:34Instantiate a 16-bit barrel shifter and check out its graph, noting the importance of the mask being off the critical path

🏃

🏃

1:58:02Funnel shifters

🗩

1:58:02Funnel shifters

🗩

1:58:02Funnel shifters

🗩

2:02:30Introduce double_width_shifter() as a funnel shifter

2:02:30Introduce double_width_shifter() as a funnel shifter

2:02:30Introduce double_width_shifter() as a funnel shifter

2:06:15Define Example24 as a funnel shifter

2:06:15Define Example24 as a funnel shifter

2:06:15Define Example24 as a funnel shifter

2:07:09Instantiate a 16-bit funnel shifter and check out its graph, to see that it is off-by-one

🏃

2:07:09Instantiate a 16-bit funnel shifter and check out its graph, to see that it is off-by-one

🏃

2:07:09Instantiate a 16-bit funnel shifter and check out its graph, to see that it is off-by-one

🏃

2:10:21Shrink the x input of our funnel shifter by one bit

2:10:21Shrink the x input of our funnel shifter by one bit

2:10:21Shrink the x input of our funnel shifter by one bit

2:10:38Check out our funnel shifter graph to see that it looks good

🏃

2:10:38Check out our funnel shifter graph to see that it looks good

🏃

2:10:38Check out our funnel shifter graph to see that it looks good

🏃

2:10:50Rename double_width_shifter() to funnel_shifter()

2:10:50Rename double_width_shifter() to funnel_shifter()

2:10:50Rename double_width_shifter() to funnel_shifter()

2:11:17Create a test of our funnel shifter

2:11:17Create a test of our funnel shifter

2:11:17Create a test of our funnel shifter

2:13:48Simulate a 16-bit and 4-bit funnel shifter to see that it passes

🏃

2:13:48Simulate a 16-bit and 4-bit funnel shifter to see that it passes

🏃

2:13:48Simulate a 16-bit and 4-bit funnel shifter to see that it passes

🏃

2:14:17Introduce funnel_right_shifter()

2:14:17Introduce funnel_right_shifter()

2:14:17Introduce funnel_right_shifter()

2:16:33Simulate a funnel right shifter to see that it passes

🏃

2:16:33Simulate a funnel right shifter to see that it passes

🏃

2:16:33Simulate a funnel right shifter to see that it passes

🏃

2:16:59Introduce funnel_left_shifter()

2:16:59Introduce funnel_left_shifter()

2:16:59Introduce funnel_left_shifter()

2:18:33Simulate a funnel left shifter to see that it fails

🏃

2:18:33Simulate a funnel left shifter to see that it fails

🏃

2:18:33Simulate a funnel left shifter to see that it fails

🏃

2:19:40Fix funnel_left_shifter()

2:19:40Fix funnel_left_shifter()

2:19:40Fix funnel_left_shifter()

2:20:06Introduce funnel_arithmetic_right_shifter()

2:20:06Introduce funnel_arithmetic_right_shifter()

2:20:06Introduce funnel_arithmetic_right_shifter()

2:21:44Simulate the funnel arithmetic right shifter, fail the test and investigate why

🏃

2:21:44Simulate the funnel arithmetic right shifter, fail the test and investigate why

🏃

2:21:44Simulate the funnel arithmetic right shifter, fail the test and investigate why

🏃

2:25:31Make funnel_arithmetic_right_shifter() use rep()

2:25:31Make funnel_arithmetic_right_shifter() use rep()

2:25:31Make funnel_arithmetic_right_shifter() use rep()

2:25:44Simulate the funnel arithmetic right shifter and pass the test

🏃

2:25:44Simulate the funnel arithmetic right shifter and pass the test

🏃

2:25:44Simulate the funnel arithmetic right shifter and pass the test

🏃

2:26:33Introduce funnel_right_rotator()

2:26:33Introduce funnel_right_rotator()

2:26:33Introduce funnel_right_rotator()

2:27:48Simulate the funnel right rotator successfully

🏃

2:27:48Simulate the funnel right rotator successfully

🏃

2:27:48Simulate the funnel right rotator successfully

🏃

2:27:54Introduce funnel_left_rotator()

2:27:54Introduce funnel_left_rotator()

2:27:54Introduce funnel_left_rotator()

2:28:35Simulate the funnel left rotator and fail the test

🏃

2:28:35Simulate the funnel left rotator and fail the test

🏃

2:28:35Simulate the funnel left rotator and fail the test

🏃

2:29:03Fix funnel_left_rotator() to slice off the correct bit

2:29:03Fix funnel_left_rotator() to slice off the correct bit

2:29:03Fix funnel_left_rotator() to slice off the correct bit

2:29:09Simulate the funnel left rotator successfully

🏃

2:29:09Simulate the funnel left rotator successfully

🏃

2:29:09Simulate the funnel left rotator successfully

🏃

2:29:17Introduce funnel_shifter_unit() as a combined design

2:29:17Introduce funnel_shifter_unit() as a combined design

2:29:17Introduce funnel_shifter_unit() as a combined design

2:31:27Q&A

🗩

2:31:27Q&A

🗩

2:31:27Q&A

🗩

2:32:50Try to time the performance of our barrel shifter, modifying get_operator_delay() to handle the necessary operators

2:32:50Try to time the performance of our barrel shifter, modifying get_operator_delay() to handle the necessary operators

2:34:38Check out the delay of our barrel shifter

🏃

2:34:38Check out the delay of our barrel shifter

🏃

2:34:38Check out the delay of our barrel shifter

🏃

2:35:38Call it a day

🗩

2:35:38Call it a day

🗩

2:35:38Call it a day

🗩

⏬

Next: 'Logic Design, Part 7'

⏬