0
1
00:00:01,030 --> 00:00:07,930
Bitwise logical operators apply logical operations on a set of bits denoted by an arbitrary precision 
1

2
00:00:07,930 --> 00:00:08,200
data.
2

3
00:00:08,800 --> 00:00:12,400
The goal of this lecture is to introduce these operators. 
3

4
00:00:14,550 --> 00:00:17,840
Bitwise logical operators all return a value with a width 
4

5
00:00:18,120 --> 00:00:25,110
that is the maximum of the widths of the two operands. They are treated as unsigned if and only if both 
5

6
00:00:25,110 --> 00:00:26,400
operands are unsigned.
6

7
00:00:26,820 --> 00:00:29,310
Otherwise, it is of a signed type.
7

8
00:00:30,700 --> 00:00:37,630
Sign-extension (or zero-padding) may occur, based on the signedness of the expression, not the destination 
8

9
00:00:37,630 --> 00:00:38,140
variable.
9

10
00:00:39,230 --> 00:00:44,570
The main bitwise logical operators are bitwise OR, AND, XOR, and Inverse. 
10

11
00:00:45,610 --> 00:00:53,380
If we assume, the two a and b variables and c represents their bitwise OR then the value of the c is 
11

12
00:00:53,380 --> 00:00:54,520
as shown in this figure.
12

13
00:00:56,630 --> 00:01:04,310
Reduced functions apply a given operator to all bits of an arbitrary precision value and return a one-bit 
13

14
00:01:04,310 --> 00:01:05,020
result.
14

15
00:01:06,050 --> 00:01:07,370
These functions include :
15

16
00:01:08,330 --> 00:01:16,370
AND reduce, OR reduce, XOR reduce, NAND reduce, NOR reduce, and XNOR reduce.
16

17
00:01:17,820 --> 00:01:25,830
If we assume the 7-bit variable a contains the value of 0101111, then its 
17

18
00:01:25,830 --> 00:01:27,990
reduced XOR would be 1.
18

19
00:01:30,960 --> 00:01:37,500
The bit reverse member function is another bit manipulation operator in Vivado HLS that reveres the bits’ positions 
19

20
00:01:37,500 --> 00:01:38,700
of its object value.
20

21
00:01:40,510 --> 00:01:48,700
For example, if the 7-bit variable a holds 0101111. Then after calling the 
21

22
00:01:48,710 --> 00:01:54,580
reverse function, its value would be 1111010.
22

23
00:01:56,740 --> 00:02:03,970
The three-member-functions, test, set, and clear work on a single bit. The test member function checks 
23

24
00:02:03,970 --> 00:02:12,180
whether a specified bit is 1 or 0, and returns true if Yes and false if No.
24

25
00:02:12,580 --> 00:02:19,000
The set(i, v) sets the specified bit denoted by I  to v.
25

26
00:02:19,000 --> 00:02:27,310
The set(i) sets the specified bit denoted by i  to 1. The clear(i) sets the specified bit denoted by i  to 
26

27
00:02:27,310 --> 00:02:27,580
0.
27

28
00:02:29,970 --> 00:02:36,630
Bit Shif and rotate operators are other groups of operations used in hardware design. The next lecture
28

29
00:02:36,790 --> 00:02:38,400
addresses these concepts.
29

30
00:02:41,170 --> 00:02:48,700
These are our takeaway messages.  The bitwise logical operators all return a value with a width that 
30

31
00:02:48,700 --> 00:02:55,840
is the maximum of the widths of the two operands. 	Reduced functions apply a given operator to all bits 
31

32
00:02:55,840 --> 00:03:00,010
of an arbitrary precision value and return a one-bit result. 
32

33
00:03:01,090 --> 00:03:05,320
The bit-reverse member function reveres the bit position of its object value.
33

34
00:03:07,060 --> 00:03:13,660
Now the quiz question. What is the output of this code snippet running by Vivado-HLS in C-Simulation mode?
