0
1
00:00:01,070 --> 00:00:06,180
Shifting and moving bits in place are the common operators in hardware design. In this lecture, 
1

2
00:00:06,320 --> 00:00:10,190
I will explain how to describe these operations in Vivado-HLS.
2

3
00:00:11,730 --> 00:00:17,770
The builtin shift operators in C/C++ are overloaded to be used for the HLS arbitrary-precision 
3

4
00:00:17,790 --> 00:00:20,640
data types. There are two bitwise shift operators:
4

5
00:00:22,080 --> 00:00:22,920
Right shift (>>),
5

6
00:00:28,420 --> 00:00:29,040
Left shift (<<).
6

7
00:00:38,050 --> 00:00:44,440
There are two versions of each shift operator:  unsigned and signed. A negative value applied to the
7

8
00:00:44,440 --> 00:00:48,550
RHS of the signed version reverses the shift direction.
8

9
00:00:50,210 --> 00:00:52,700
These are four examples of different shift operators. 
9

10
00:00:54,200 --> 00:00:59,690
The first one is a 3-bit positive shift right. The second one is a 3-bit negative shift 
10

11
00:00:59,690 --> 00:01:02,270
right which is equal to 3-bit  shift left.
11

12
00:01:02,960 --> 00:01:09,950
The third one is a 3-bit positive shift left. And the last one is a 3-bit negative shift left 
12

13
00:01:10,160 --> 00:01:12,380
which is equal to 3-bit  shift right.
13

14
00:01:16,320 --> 00:01:21,930
Vivado HLS provides two member functions to perform rotate operations on arbitrary-precision 
14

15
00:01:21,930 --> 00:01:28,560
data types. The rrotate member function performs the rotate right. And the lrotate member function 
15

16
00:01:28,560 --> 00:01:29,940
performs the rotate left 
16

17
00:01:32,060 --> 00:01:37,760
This lecture is the last in this section that explained the design concepts and techniques. So the 
17

18
00:01:37,760 --> 00:01:43,940
next lecture will give you a couple of hardware designs as exercises through which you review and master 
18

19
00:01:43,940 --> 00:01:45,770
the proposed techniques in this section. 
19

20
00:01:48,250 --> 00:01:49,840
These are our takeaway messages.
20

21
00:01:51,390 --> 00:01:55,950
Vivado-HLS has overloaded the native C/C++ shift operators.
21

22
00:01:57,250 --> 00:02:00,190
Rotate operations are provided through member functions.
22

23
00:02:03,500 --> 00:02:10,290
Now the quiz question. Find the values of r1, r2 and r3 after running this code snippet in 
23

24
00:02:10,490 --> 00:02:11,140
Vivado-HLS.
