0
1
00:00:00,870 --> 00:00:07,800
How can we describe conditional statements in software and hardware? This lecture introduces you to
1

2
00:00:07,920 --> 00:00:11,880
simple implementations of conditional statements in software and hardware.
2

3
00:00:14,130 --> 00:00:22,500
A conditional statement has two parts: hypothesis and conclusion. If the hypothesis is correct, then 
3

4
00:00:22,500 --> 00:00:23,680
the conclusion will occur.  
4

5
00:00:25,140 --> 00:00:31,710
In a software program, usually, an if-then structure is used to describe a condition. An if-then 
5

6
00:00:31,710 --> 00:00:39,690
structure usually has two parts: a boolean expression or hypothesis and a block containing a consequence
6

7
00:00:39,930 --> 00:00:40,970
or conclusion.
7

8
00:00:43,110 --> 00:00:49,890
In a general case of the conditional statement, a selection between a consequence and its alternative
8

9
00:00:49,890 --> 00:00:50,490
may happen.
9

10
00:00:51,840 --> 00:00:56,690
If the Boolean expression is true, then the consequence block is selected; 
10

11
00:00:57,090 --> 00:01:00,480
otherwise, the alternative part will be chosen.
11

12
00:01:02,870 --> 00:01:08,480
In logic design, a switch can implement the conditional statement. In the simplest form, a select bit 
12

13
00:01:08,480 --> 00:01:12,560
controls the switch and the connection between the input and output bits.
13

14
00:01:14,150 --> 00:01:20,870
If the select bit is 0, the input is not connected to the output. Otherwise, the output is the input. 
14

15
00:01:22,270 --> 00:01:26,890
In the generalized form, the switch can select between two or more options.
15

16
00:01:28,290 --> 00:01:33,800
For example, if the select bit is zero, the first input is connected to the output, 
16

17
00:01:34,780 --> 00:01:37,630
and if it is one the output in the second input.
17

18
00:01:39,010 --> 00:01:44,510
How can we use logic gates to implement conditional statements? To cope with this question, 
18

19
00:01:44,530 --> 00:01:50,140
I will explain the concept of a multiplexer and its implementation with logic gates in the next lecture. 
19

20
00:01:51,340 --> 00:01:58,080
These are our takeaway messages: Each decision-making process has at least one Hypothesis and one Conclusion. 
20

21
00:01:58,450 --> 00:02:05,290
If the hypothesis is correct, then the conclusion will occur.  If statements in software and switches 
21

22
00:02:05,290 --> 00:02:09,280
in hardware are the building blocks of decision-making processes.
22

23
00:02:10,460 --> 00:02:16,850
Now the quiz question. How can we use the following hardware switches to implement a decision-making process 
23

24
00:02:17,000 --> 00:02:18,730
with four options for selection?
