WEBVTT

1
00:00:00.080 --> 00:00:03.919
<v Speaker 1>Okay, so let's unpack this. It is Thursday, February twenty sixth,

2
00:00:04.040 --> 00:00:08.119
<v Speaker 1>twenty twenty six, and today we are going to look

3
00:00:08.160 --> 00:00:10.880
<v Speaker 1>at something that is literally all around.

4
00:00:10.599 --> 00:00:12.519
<v Speaker 2>You right now, well absolutely everywhere.

5
00:00:12.640 --> 00:00:14.960
<v Speaker 1>Yeah, Like it is probably on your mist it's definitely

6
00:00:15.000 --> 00:00:17.920
<v Speaker 1>in your pocket, it's in your car, and it might

7
00:00:17.960 --> 00:00:20.120
<v Speaker 1>even be in your toaster. But you never really.

8
00:00:19.879 --> 00:00:22.879
<v Speaker 2>See it, right, which is I mean, that's the mark

9
00:00:22.920 --> 00:00:25.760
<v Speaker 2>of a good design, right, If it's working perfectly, it's

10
00:00:25.800 --> 00:00:28.760
<v Speaker 2>completely invisible. It's kind of the dark matter of the

11
00:00:28.800 --> 00:00:29.359
<v Speaker 2>digital world.

12
00:00:29.480 --> 00:00:32.359
<v Speaker 1>The dark matter. I love that exactly. So we are

13
00:00:32.399 --> 00:00:36.200
<v Speaker 1>doing a deep dive today into the invisible digital infrastructure

14
00:00:36.280 --> 00:00:39.039
<v Speaker 1>that basically runs the modern world. We are talking about

15
00:00:39.039 --> 00:00:43.560
<v Speaker 1>embedded systems and to guide us through this absolute maze

16
00:00:43.719 --> 00:00:47.039
<v Speaker 1>of you know, wires and logic gates, we're doing a

17
00:00:47.039 --> 00:00:50.039
<v Speaker 1>deep dive into the source material here, which is the

18
00:00:50.079 --> 00:00:53.840
<v Speaker 1>book Architecting High Performance Embedded Systems by Jim Leaden.

19
00:00:53.960 --> 00:00:56.039
<v Speaker 2>It's a fantastic resource.

20
00:00:55.759 --> 00:00:57.479
<v Speaker 1>It really is. Now. I have to admit, when I

21
00:00:57.520 --> 00:00:59.840
<v Speaker 1>first saw the title, I thought, well, I thought, okay,

22
00:00:59.840 --> 00:01:02.280
<v Speaker 1>this is going to be a super dry technical manual.

23
00:01:02.359 --> 00:01:03.759
<v Speaker 2>Sure, yeah, it sounds like one.

24
00:01:03.799 --> 00:01:06.640
<v Speaker 1>Right, but it's actually a beast of a book. I

25
00:01:06.640 --> 00:01:10.439
<v Speaker 1>mean it covers everything from the literal physics of sensors

26
00:01:10.920 --> 00:01:13.239
<v Speaker 1>all the way up to computer chips that can basically

27
00:01:13.280 --> 00:01:14.560
<v Speaker 1>rewire themselves on the fly.

28
00:01:14.920 --> 00:01:17.400
<v Speaker 2>It is a comprehensive guide for sure. And what I

29
00:01:17.439 --> 00:01:21.040
<v Speaker 2>really appreciate about Lenins approaching this book is that he

30
00:01:21.079 --> 00:01:24.719
<v Speaker 2>doesn't just treat these systems as well as like small computers.

31
00:01:25.280 --> 00:01:29.359
<v Speaker 2>He really emphasizes the immense complexity and the precision that's

32
00:01:29.400 --> 00:01:33.200
<v Speaker 2>required to actually make them work. Because you know, unlike

33
00:01:33.200 --> 00:01:35.560
<v Speaker 2>your laptop, which just sits in a nice air conditioned

34
00:01:35.640 --> 00:01:39.519
<v Speaker 2>room or on your desk hopefully right, hopefully, these embedded

35
00:01:39.519 --> 00:01:41.280
<v Speaker 2>systems they live out in the real world there in

36
00:01:41.319 --> 00:01:44.079
<v Speaker 2>the mud, the heat, the freezing rain, and you know,

37
00:01:44.560 --> 00:01:46.879
<v Speaker 2>literally bolted inside exploding car engines.

38
00:01:47.000 --> 00:01:49.239
<v Speaker 1>Yeah, the environment is brutal. So let's start with the

39
00:01:49.239 --> 00:01:52.439
<v Speaker 1>basics for you listening, what actually counts as an embedded system?

40
00:01:52.519 --> 00:01:54.640
<v Speaker 1>Because I feel like that term gets thrown around a lot,

41
00:01:54.719 --> 00:01:57.000
<v Speaker 1>like I have a laptop, I have a smartphone, I

42
00:01:57.040 --> 00:02:00.280
<v Speaker 1>have a car. Are they all embedded system?

43
00:02:00.480 --> 00:02:03.159
<v Speaker 2>It's a really great question to start with. The core

44
00:02:03.200 --> 00:02:07.640
<v Speaker 2>definition Leaden gives is pretty specific. An embedded system is

45
00:02:07.719 --> 00:02:11.439
<v Speaker 2>digital processing that is integrated into a device that has

46
00:02:11.439 --> 00:02:13.800
<v Speaker 2>a larger purpose beyond just computing.

47
00:02:14.000 --> 00:02:17.120
<v Speaker 1>Well, okay, unpack that a bit, a larger purpose beyond computing.

48
00:02:17.240 --> 00:02:20.639
<v Speaker 2>Yeah, so think about your laptop. Its entire purpose is

49
00:02:20.680 --> 00:02:23.400
<v Speaker 2>to compute. It is a general purpose machine. Right. You

50
00:02:23.400 --> 00:02:25.400
<v Speaker 2>can use it to write a novel, you can edit

51
00:02:25.439 --> 00:02:28.759
<v Speaker 2>a video, you can calculate a giant spreadsheet. It's flexible.

52
00:02:29.240 --> 00:02:32.719
<v Speaker 2>But a car, a car's purpose is to move people

53
00:02:32.719 --> 00:02:35.520
<v Speaker 2>from point A to point B right to drive exactly.

54
00:02:35.919 --> 00:02:39.680
<v Speaker 2>The computers inside the car are just there to facilitate

55
00:02:39.719 --> 00:02:41.639
<v Speaker 2>that physical movement. They are specialists.

56
00:02:41.919 --> 00:02:44.240
<v Speaker 1>Okay, So the laptop is the jack of all trades

57
00:02:44.400 --> 00:02:46.439
<v Speaker 1>and the embedded system is the master of one.

58
00:02:46.560 --> 00:02:49.960
<v Speaker 2>Precisely, And Lettin uses a really great simple example to

59
00:02:50.039 --> 00:02:52.560
<v Speaker 2>draw the line here. He calls it the toothbrush test.

60
00:02:52.680 --> 00:02:55.080
<v Speaker 1>The toothbrush test. Okay, I love this. Break it down.

61
00:02:55.199 --> 00:02:58.800
<v Speaker 2>So take a standard electric toothbrush from say, maybe twenty

62
00:02:58.879 --> 00:03:01.919
<v Speaker 2>years ago. Bat a motor and the little physical switch

63
00:03:02.240 --> 00:03:04.879
<v Speaker 2>you turn it on, the circuit closes, the motor spins,

64
00:03:05.159 --> 00:03:08.000
<v Speaker 2>and you brush your teeth. Is that an embedded system.

65
00:03:08.039 --> 00:03:12.280
<v Speaker 1>I'm gonna guess. No, I mean it's just it's electric, right,

66
00:03:12.360 --> 00:03:13.960
<v Speaker 1>It's just mechanics and a battery.

67
00:03:14.120 --> 00:03:17.759
<v Speaker 2>Right. There is no digital processing happening. It's just dumb logic.

68
00:03:18.039 --> 00:03:18.280
<v Speaker 1>Right.

69
00:03:18.439 --> 00:03:22.680
<v Speaker 2>But take a modern smart toothbrush, the kind that lights

70
00:03:22.759 --> 00:03:25.639
<v Speaker 2>up red if you press too hard against your gums.

71
00:03:25.680 --> 00:03:27.840
<v Speaker 1>Oh yeah, I have one of those. It actively gets

72
00:03:27.840 --> 00:03:28.479
<v Speaker 1>angry at.

73
00:03:28.400 --> 00:03:32.199
<v Speaker 2>Me exactly, and that anger requires intelligence. It has a

74
00:03:32.199 --> 00:03:36.639
<v Speaker 2>physical sensor to measure pressure. That sensor feeds analog data

75
00:03:36.680 --> 00:03:39.360
<v Speaker 2>to a tiny micro controller okay, and then the micro

76
00:03:39.400 --> 00:03:43.479
<v Speaker 2>controller processes that data and mathematically decides, hey, that is

77
00:03:43.520 --> 00:03:45.479
<v Speaker 2>too much force. I need to turn on the red

78
00:03:45.599 --> 00:03:47.120
<v Speaker 2>led and slow down the motor.

79
00:03:48.159 --> 00:03:51.080
<v Speaker 1>That whole loop, that is an embedded system. It is

80
00:03:51.120 --> 00:03:54.400
<v Speaker 1>a layer of digital thinking tucked inside an everyday object.

81
00:03:54.520 --> 00:03:57.240
<v Speaker 2>Wow. And unlike my laptop, which, let's be honest, I

82
00:03:57.319 --> 00:03:58.599
<v Speaker 2>have to reboot like once a week because it just

83
00:03:58.599 --> 00:04:02.080
<v Speaker 2>gets confused. Yeah, things have to be incredibly robust.

84
00:04:02.560 --> 00:04:05.599
<v Speaker 1>That is the other massive key distinction here. These systems

85
00:04:05.639 --> 00:04:08.400
<v Speaker 1>don't usually have nice cooling fans. They have to survive

86
00:04:08.520 --> 00:04:12.319
<v Speaker 1>intense vibration, dust, wild temperature swings.

87
00:04:12.000 --> 00:04:15.000
<v Speaker 2>Because they're in the real world. Exactly. Think about it.

88
00:04:15.039 --> 00:04:19.279
<v Speaker 2>If your laptop crashes, you lose an unsaved word document annoying,

89
00:04:19.439 --> 00:04:22.079
<v Speaker 2>but fine. If the embedded system in your car is

90
00:04:22.160 --> 00:04:25.720
<v Speaker 2>anti lock breaking, unit crashes, oh man. The consequences are

91
00:04:25.720 --> 00:04:27.639
<v Speaker 2>physical and they are immediate.

92
00:04:27.759 --> 00:04:31.120
<v Speaker 1>That makes total sense. And this naturally bleeds into I

93
00:04:31.199 --> 00:04:33.759
<v Speaker 1>think the biggest buzzword of the last decade, which is

94
00:04:33.800 --> 00:04:36.720
<v Speaker 1>the Internet of things or IoT because once you have

95
00:04:36.800 --> 00:04:40.680
<v Speaker 1>that smart toothbrush, the next logical step for a company

96
00:04:40.759 --> 00:04:42.639
<v Speaker 1>is to make it talk to your phone. Right.

97
00:04:42.759 --> 00:04:45.600
<v Speaker 2>That is the natural evolution, and let draws a very

98
00:04:45.639 --> 00:04:48.759
<v Speaker 2>clear line there in the source material. Embedded systems evolve

99
00:04:48.800 --> 00:04:51.160
<v Speaker 2>into the Internet of things when they start communicating with

100
00:04:51.240 --> 00:04:54.800
<v Speaker 2>central nodes. It's all about massive network communication.

101
00:04:55.120 --> 00:04:57.519
<v Speaker 1>The book mentions some examples that really show the sheer

102
00:04:57.519 --> 00:05:00.879
<v Speaker 1>scale of this. On one hand, you have everyday stuff

103
00:05:00.959 --> 00:05:04.639
<v Speaker 1>like smart speakers, your Amazon Echo, Google Nest sitting in

104
00:05:04.680 --> 00:05:06.759
<v Speaker 1>your living room just waiting for a wake word.

105
00:05:06.720 --> 00:05:10.879
<v Speaker 2>Right, an admitted system that's listening, processing audio locally, and

106
00:05:10.920 --> 00:05:12.199
<v Speaker 2>then communicating with the cloud.

107
00:05:12.439 --> 00:05:15.879
<v Speaker 1>But then you connect that same concept to the industrial side.

108
00:05:16.079 --> 00:05:19.800
<v Speaker 1>Think about an oil pipeline. You have embedded systems monitoring

109
00:05:19.879 --> 00:05:24.959
<v Speaker 1>flow rates, pressure and temperature over thousands of miles of

110
00:05:25.040 --> 00:05:26.040
<v Speaker 1>pipe exactly.

111
00:05:26.120 --> 00:05:28.079
<v Speaker 2>So instead of a guy in a truck having to

112
00:05:28.160 --> 00:05:29.920
<v Speaker 2>drive out into the middle of nowhere to check a

113
00:05:29.959 --> 00:05:30.800
<v Speaker 2>physical gauge.

114
00:05:30.879 --> 00:05:33.759
<v Speaker 1>The pope itself basically sends a text message saying, Hey,

115
00:05:33.839 --> 00:05:34.399
<v Speaker 1>I'm leaking.

116
00:05:34.720 --> 00:05:39.079
<v Speaker 2>Yes. Yeah, it's incredibly efficient, but this is a big butt.

117
00:05:39.800 --> 00:05:43.319
<v Speaker 2>The book issues a pretty stark warning here regarding security.

118
00:05:43.399 --> 00:05:45.680
<v Speaker 2>Oh absolutely, because when you take a device that was

119
00:05:45.720 --> 00:05:49.360
<v Speaker 2>originally designed to be a simple, isolated specialist, like a

120
00:05:49.360 --> 00:05:52.560
<v Speaker 2>home thermostat or a pipeline valve, and you suddenly give

121
00:05:52.560 --> 00:05:55.279
<v Speaker 2>it a live Internet connection, you are opening a door.

122
00:05:55.560 --> 00:05:58.519
<v Speaker 1>And historically these things aren't exactly built with Fort Knox

123
00:05:58.600 --> 00:05:59.839
<v Speaker 1>level security, are they No.

124
00:06:00.199 --> 00:06:03.399
<v Speaker 2>Historically they are not. And that's exactly the danger. If

125
00:06:03.439 --> 00:06:07.120
<v Speaker 2>a malicious actor hacks your personal laptop, they might steal

126
00:06:07.240 --> 00:06:11.519
<v Speaker 2>your credit card info. That is bad, obviously, but it's manageable.

127
00:06:11.680 --> 00:06:15.000
<v Speaker 2>But if they hack an IoT system like a medical

128
00:06:15.000 --> 00:06:18.199
<v Speaker 2>pacemaker or that oil pipeline we mentioned, or the steering

129
00:06:18.240 --> 00:06:21.240
<v Speaker 2>control of a connected car, we aren't talking about data

130
00:06:21.279 --> 00:06:25.879
<v Speaker 2>loss anymore. We are talking about severe risks to physical safety.

131
00:06:25.920 --> 00:06:28.959
<v Speaker 1>It's the difference between a privacy nightmare and a literal

132
00:06:29.000 --> 00:06:29.800
<v Speaker 1>safety crisis.

133
00:06:29.879 --> 00:06:34.120
<v Speaker 2>Yeah, exactly. Leaden emphasizes that in this new IoT world.

134
00:06:34.439 --> 00:06:37.560
<v Speaker 2>Security cannot just be a software pass you add on later.

135
00:06:38.120 --> 00:06:40.680
<v Speaker 2>It has be baked into the very architecture of the

136
00:06:40.720 --> 00:06:41.879
<v Speaker 2>hardware from day one.

137
00:06:42.160 --> 00:06:45.519
<v Speaker 1>It's terrifying but also fascinating. Okay, let's step back a

138
00:06:45.519 --> 00:06:47.879
<v Speaker 1>bit and look at how these systems actually interact with

139
00:06:47.920 --> 00:06:50.079
<v Speaker 1>the physical world. Because a computer chip, at the end

140
00:06:50.079 --> 00:06:52.839
<v Speaker 1>of the day only knows ones and zeros. It doesn't

141
00:06:52.839 --> 00:06:55.439
<v Speaker 1>know what hot or fast or loud actually feels like.

142
00:06:55.600 --> 00:06:57.879
<v Speaker 1>It lives in this dark digital bubble.

143
00:06:58.160 --> 00:07:00.439
<v Speaker 2>And this is the realm of sensors. This is how

144
00:07:00.480 --> 00:07:05.399
<v Speaker 2>the system literally senses the outside world. Letting categorizes them

145
00:07:05.399 --> 00:07:07.519
<v Speaker 2>into two main buckets in the book that are super

146
00:07:07.560 --> 00:07:10.360
<v Speaker 2>helpful to understand, passive and active sensors.

147
00:07:10.480 --> 00:07:13.199
<v Speaker 1>Okay, passive sounds a bit safer. What is a passive sensor?

148
00:07:13.439 --> 00:07:16.480
<v Speaker 2>A passive sensor just sits there and measures the environment

149
00:07:16.560 --> 00:07:19.800
<v Speaker 2>exactly as it is. It's observant. A classic example he

150
00:07:19.839 --> 00:07:22.399
<v Speaker 2>gives as a thermister. A thermister, Yeah, it's a special

151
00:07:22.439 --> 00:07:25.120
<v Speaker 2>type of resistor that changes its electrical resistance based on

152
00:07:25.120 --> 00:07:27.720
<v Speaker 2>the ambient temperature. It's not doing anything to the air

153
00:07:27.759 --> 00:07:30.079
<v Speaker 2>around it. It's just reacting to the heat.

154
00:07:30.279 --> 00:07:33.000
<v Speaker 1>Okay, so kind of like a sponge soaking up water.

155
00:07:33.399 --> 00:07:36.399
<v Speaker 1>It changes its state based on the environment, but it

156
00:07:36.480 --> 00:07:38.000
<v Speaker 1>doesn't spray water back out.

157
00:07:38.160 --> 00:07:41.680
<v Speaker 2>That's a great analogy. Now contrast that with an active sensor.

158
00:07:41.680 --> 00:07:44.360
<v Speaker 2>An active sensor actually goes out and pokes the world

159
00:07:44.639 --> 00:07:45.519
<v Speaker 2>to see what happens.

160
00:07:45.639 --> 00:07:47.560
<v Speaker 1>It pokes the world.

161
00:07:47.199 --> 00:07:49.959
<v Speaker 2>Well in a way. Yes, think about an ultrasonic sensor.

162
00:07:50.120 --> 00:07:51.920
<v Speaker 2>These are used a lot in robotics and in the

163
00:07:51.959 --> 00:07:53.879
<v Speaker 2>parking sensors on your car bumber.

164
00:07:53.600 --> 00:07:55.360
<v Speaker 1>Oh, the ones that beep when you get too close

165
00:07:55.360 --> 00:07:55.879
<v Speaker 1>to a wall.

166
00:07:56.079 --> 00:08:00.759
<v Speaker 2>Exactly, that sensor actively sends out a ping, a high

167
00:08:00.839 --> 00:08:03.680
<v Speaker 2>frequency sound wave. Yeah, and then it immediately switches into

168
00:08:03.759 --> 00:08:06.959
<v Speaker 2>listening mode and waits to hear the echo bouncing back like.

169
00:08:06.920 --> 00:08:10.360
<v Speaker 1>A bat using echolocation or submarine.

170
00:08:09.879 --> 00:08:13.040
<v Speaker 2>Exactly like that. It uses a concept called time of flight.

171
00:08:13.639 --> 00:08:15.839
<v Speaker 2>The system knows the exact speed of sound, so it

172
00:08:15.879 --> 00:08:19.000
<v Speaker 2>sends the ping out, starts a tiny internal stopwatch. Here's

173
00:08:19.040 --> 00:08:21.040
<v Speaker 2>the echo return, and stops the watch.

174
00:08:21.160 --> 00:08:22.800
<v Speaker 1>Oh, and then it just does the math.

175
00:08:22.800 --> 00:08:25.439
<v Speaker 2>Right, the time it took tells you exactly how far

176
00:08:25.439 --> 00:08:28.480
<v Speaker 2>away the physical wall is. That is active sensing. You

177
00:08:28.560 --> 00:08:31.639
<v Speaker 2>generate a stimulus and you measure the real world response, and.

178
00:08:31.560 --> 00:08:35.159
<v Speaker 1>The source material mentions lightar and radar working on similar principles.

179
00:08:35.240 --> 00:08:39.159
<v Speaker 2>Right, Yes, lightar is completely fascinating. Instead of sound waves,

180
00:08:39.240 --> 00:08:43.120
<v Speaker 2>it uses pulses of laser light. By spinning that laser

181
00:08:43.159 --> 00:08:46.159
<v Speaker 2>around and measuring millions of those time of flight returns

182
00:08:46.200 --> 00:08:49.519
<v Speaker 2>every single second, an autonomous vehicle can build what's called

183
00:08:49.519 --> 00:08:52.440
<v Speaker 2>a point clide a point cloud. Yeah, it's basically a

184
00:08:52.480 --> 00:08:55.519
<v Speaker 2>real time three D map of the entire world around

185
00:08:55.519 --> 00:08:58.440
<v Speaker 2>the car. The computer knows that this specific cluster of

186
00:08:58.519 --> 00:09:01.840
<v Speaker 2>data points is a pedestrian walking, that cluster over there

187
00:09:01.960 --> 00:09:04.759
<v Speaker 2>is a stationary tree, and that fast moving cluster is

188
00:09:04.799 --> 00:09:09.000
<v Speaker 2>another car. It's literally seeing the world in three D geometry.

189
00:09:09.200 --> 00:09:11.840
<v Speaker 1>That is just incredible. But here is where it gets

190
00:09:11.879 --> 00:09:15.600
<v Speaker 1>really technical and honestly, I think really interesting. The real

191
00:09:15.639 --> 00:09:20.080
<v Speaker 1>world is analog like. Temperature doesn't just jump from seventy

192
00:09:20.120 --> 00:09:23.080
<v Speaker 1>degrees to seventy one degrees in a single instant step.

193
00:09:23.600 --> 00:09:28.039
<v Speaker 1>It flows smoothly, it's continuous, right, But computers are digital.

194
00:09:28.320 --> 00:09:31.960
<v Speaker 1>They only understand distinct steps. They're choppy. So how do

195
00:09:32.039 --> 00:09:35.240
<v Speaker 1>we bridge that gap between a smooth world and a

196
00:09:35.320 --> 00:09:36.039
<v Speaker 1>choppy computer.

197
00:09:36.399 --> 00:09:39.519
<v Speaker 2>That crucial job falls to the ADC. The analog to

198
00:09:39.600 --> 00:09:43.759
<v Speaker 2>digital converter. It acts as the ultimate translator. Imagine you

199
00:09:43.799 --> 00:09:46.799
<v Speaker 2>are drawing a smooth, sweeping curve on a piece of

200
00:09:46.799 --> 00:09:47.399
<v Speaker 2>graph paper.

201
00:09:47.440 --> 00:09:48.360
<v Speaker 1>Okay, I'm picturing it.

202
00:09:48.519 --> 00:09:52.200
<v Speaker 2>The real physical world is that smooth curve. The ADC

203
00:09:52.440 --> 00:09:55.240
<v Speaker 2>is looking at that curve at very specific tiny points

204
00:09:55.240 --> 00:09:57.480
<v Speaker 2>in time. This is called sampling it, and it's turning

205
00:09:57.519 --> 00:10:00.279
<v Speaker 2>each specific point into a precise digital number.

206
00:10:00.399 --> 00:10:02.240
<v Speaker 1>So if you don't sample it fast enough, you miss

207
00:10:02.279 --> 00:10:04.000
<v Speaker 1>all the details of the current exactly.

208
00:10:04.039 --> 00:10:06.840
<v Speaker 2>That's a problem called aliasing. If you blink too slowly,

209
00:10:06.879 --> 00:10:09.080
<v Speaker 2>you might miss the baseball flying right past your face.

210
00:10:09.320 --> 00:10:12.000
<v Speaker 2>The source material talks about the XCDC hardware on the

211
00:10:12.080 --> 00:10:13.360
<v Speaker 2>RDA seven board.

212
00:10:13.240 --> 00:10:16.960
<v Speaker 1>Right, the RDA seven, which is a specific FPGA development

213
00:10:17.000 --> 00:10:18.200
<v Speaker 1>board they use as an example.

214
00:10:18.360 --> 00:10:22.399
<v Speaker 2>Yes, that specific hardware can sample the analog world up

215
00:10:22.480 --> 00:10:24.480
<v Speaker 2>to one million times per second.

216
00:10:24.879 --> 00:10:28.360
<v Speaker 1>One million times a second. That is, I mean, I

217
00:10:28.360 --> 00:10:29.759
<v Speaker 1>can't even wrap my head around that.

218
00:10:29.840 --> 00:10:32.600
<v Speaker 2>And honestly, that's just considered standard for high performance control.

219
00:10:33.000 --> 00:10:36.200
<v Speaker 2>Some advanced radio frequency systems sampled into the billions of

220
00:10:36.200 --> 00:10:39.600
<v Speaker 2>times per second. It creates this absolutely massive fire hose

221
00:10:39.600 --> 00:10:42.039
<v Speaker 2>of numbers that the processor then has to crunch.

222
00:10:41.759 --> 00:10:43.679
<v Speaker 1>Okay, so we have the data. Now, the sensor has

223
00:10:43.679 --> 00:10:46.919
<v Speaker 1>picked up the physical world, the ADC has translated it

224
00:10:46.960 --> 00:10:50.159
<v Speaker 1>into digital numbers. Now, how does that data actually get

225
00:10:50.200 --> 00:10:52.200
<v Speaker 1>to the main brain of the system. We need a

226
00:10:52.240 --> 00:10:53.000
<v Speaker 1>nervous system.

227
00:10:53.240 --> 00:10:56.440
<v Speaker 2>We absolutely do. And these are called the communication protocols.

228
00:10:56.840 --> 00:10:59.240
<v Speaker 2>Depending on exactly what you're trying to do, you pick

229
00:10:59.240 --> 00:11:00.600
<v Speaker 2>a different digital language.

230
00:11:00.720 --> 00:11:03.200
<v Speaker 1>Let's run through the big ones mentioned in Letin's book.

231
00:11:03.360 --> 00:11:06.360
<v Speaker 1>Start with the absolute simplest one GPIO.

232
00:11:06.679 --> 00:11:11.159
<v Speaker 2>Okay, GPIO General purpose input output. This is basically the

233
00:11:11.159 --> 00:11:14.039
<v Speaker 2>brute force method. It's usually just a single wire that

234
00:11:14.120 --> 00:11:17.919
<v Speaker 2>is either on or off high voltage or low voltage.

235
00:11:17.600 --> 00:11:19.879
<v Speaker 1>One or zero, kind of like a physical light switch.

236
00:11:20.039 --> 00:11:23.679
<v Speaker 2>Perfect analogy is the machine's safety cover open, yes or no?

237
00:11:24.559 --> 00:11:28.200
<v Speaker 2>Is the emergency button currently pressed? Yes or no? It's

238
00:11:28.240 --> 00:11:32.519
<v Speaker 2>incredibly fast, it's instant, but it obviously doesn't carry complex data.

239
00:11:32.600 --> 00:11:35.279
<v Speaker 2>You can't send a JPEG image over a light switch.

240
00:11:35.120 --> 00:11:37.519
<v Speaker 1>Right, Okay, So what if we do need to send

241
00:11:37.639 --> 00:11:40.279
<v Speaker 1>actual complex data. The book talks about a protocol called

242
00:11:40.360 --> 00:11:40.879
<v Speaker 1>I two C.

243
00:11:41.840 --> 00:11:45.080
<v Speaker 2>I two C or inter integrated Circuit. I always like

244
00:11:45.159 --> 00:11:46.639
<v Speaker 2>to call this one the polite conversation.

245
00:11:46.799 --> 00:11:47.879
<v Speaker 1>Polite Why polite?

246
00:11:47.960 --> 00:11:51.000
<v Speaker 2>Because it uses just two wires. One wire is a

247
00:11:51.039 --> 00:11:53.879
<v Speaker 2>clock to keep the timing synchronized and the other is

248
00:11:53.879 --> 00:11:56.840
<v Speaker 2>for the actual data. But it can connect multiple different

249
00:11:56.879 --> 00:12:00.320
<v Speaker 2>devices using a clever address system. It uses a master

250
00:12:00.360 --> 00:12:04.039
<v Speaker 2>servant architecture. Okay, so the master controller says, hey, Sensor A,

251
00:12:04.240 --> 00:12:07.120
<v Speaker 2>it's your turn to speak, and Sensor A talks. Then

252
00:12:07.159 --> 00:12:09.720
<v Speaker 2>the master says, okay, thank you, Sensor B, now it's

253
00:12:09.720 --> 00:12:10.159
<v Speaker 2>your turn.

254
00:12:10.559 --> 00:12:12.519
<v Speaker 1>Ah, So they actually take turns on the wire.

255
00:12:12.639 --> 00:12:15.120
<v Speaker 2>Yes, it's what we call half duplex. You can only

256
00:12:15.159 --> 00:12:18.120
<v Speaker 2>send data or receive data at one specific time, not both.

257
00:12:18.679 --> 00:12:21.600
<v Speaker 2>It's great for simple things like reading a temperature sensor

258
00:12:21.720 --> 00:12:23.600
<v Speaker 2>once a second, but it's a bit slow.

259
00:12:23.840 --> 00:12:26.080
<v Speaker 1>So what if I have a real need for speed,

260
00:12:26.200 --> 00:12:29.559
<v Speaker 1>like if I'm streaming that crazy one million sample per

261
00:12:29.600 --> 00:12:31.559
<v Speaker 1>second data from the ADC, then you.

262
00:12:31.559 --> 00:12:36.120
<v Speaker 2>Need to upgrade to SPI Serial Peripheral Interface. This is

263
00:12:36.159 --> 00:12:39.200
<v Speaker 2>the speedy connection. It uses four wires instead of two,

264
00:12:39.919 --> 00:12:43.639
<v Speaker 2>and because it has completely separate dedicated wires for sending

265
00:12:43.720 --> 00:12:45.679
<v Speaker 2>and for receiving, it is full.

266
00:12:45.559 --> 00:12:48.399
<v Speaker 1>Duplex, meaning it can talk and listen at the exact

267
00:12:48.480 --> 00:12:51.679
<v Speaker 1>same time exactly. Sounds like a chaotic argument where everyone

268
00:12:51.720 --> 00:12:52.919
<v Speaker 1>is just yelling over each other.

269
00:12:53.080 --> 00:12:56.159
<v Speaker 2>Actually, it's more like a highly efficient high speed telephone

270
00:12:56.159 --> 00:12:59.399
<v Speaker 2>call where both people are talking and perfectly understanding each

271
00:12:59.399 --> 00:13:02.360
<v Speaker 2>other simultananeously. It can run much much faster than it

272
00:13:02.480 --> 00:13:05.639
<v Speaker 2>two see easily up to fifty mega herds for more wow.

273
00:13:05.720 --> 00:13:09.039
<v Speaker 1>Okay, but what about inside cars? Because I know modern

274
00:13:09.080 --> 00:13:12.360
<v Speaker 1>cars are an absolute nightmare of electrical noise. You have

275
00:13:12.480 --> 00:13:15.799
<v Speaker 1>spark plugs firing thousands of times a minute, giant alternator

276
00:13:15.879 --> 00:13:20.159
<v Speaker 1>spinning that creates massive electromagnetic interference.

277
00:13:19.840 --> 00:13:21.559
<v Speaker 2>Very hostile environment for electronics.

278
00:13:21.639 --> 00:13:24.600
<v Speaker 1>So how do the tiny computer chips communicate without their

279
00:13:24.679 --> 00:13:27.440
<v Speaker 1>data just getting completely scrambled by all that engine noise?

280
00:13:27.799 --> 00:13:30.840
<v Speaker 2>That is exactly where the CANbus comes in the controller

281
00:13:30.879 --> 00:13:35.399
<v Speaker 2>area network. It is the absolute gold standard for automotive systems,

282
00:13:36.000 --> 00:13:39.120
<v Speaker 2>and the way it physically handles that noise is just

283
00:13:39.360 --> 00:13:40.279
<v Speaker 2>brilliant physics.

284
00:13:40.360 --> 00:13:41.519
<v Speaker 1>Okay, how does it work.

285
00:13:41.960 --> 00:13:45.720
<v Speaker 2>It uses something called differential signaling. Imagine you have two

286
00:13:45.759 --> 00:13:48.480
<v Speaker 2>separate wires running right next to each other through the car.

287
00:13:49.240 --> 00:13:51.840
<v Speaker 2>When the system wants to send a signal, it sends

288
00:13:51.879 --> 00:13:55.159
<v Speaker 2>a positive voltage down one wire and a negative voltage

289
00:13:55.200 --> 00:13:55.960
<v Speaker 2>down the other wire.

290
00:13:56.080 --> 00:13:58.159
<v Speaker 1>Okay, so like a plus one on the first wire

291
00:13:58.240 --> 00:13:59.799
<v Speaker 1>and a minus one on the second wire.

292
00:14:00.120 --> 00:14:02.759
<v Speaker 2>Right now, the receiving chip at the other end doesn't

293
00:14:02.799 --> 00:14:05.559
<v Speaker 2>look at the absolute voltage on either wire. It strictly

294
00:14:05.600 --> 00:14:08.440
<v Speaker 2>looks at the difference between the two wires. So positive

295
00:14:08.440 --> 00:14:11.639
<v Speaker 2>one minus negative one equals two. The intended signal is two.

296
00:14:11.840 --> 00:14:12.919
<v Speaker 1>Okay, I follow the math.

297
00:14:13.200 --> 00:14:16.679
<v Speaker 2>Now, imagine a huge spike of electrical noise from the

298
00:14:16.759 --> 00:14:20.399
<v Speaker 2>engine suddenly hits those wires. Because the wires are physically

299
00:14:20.399 --> 00:14:24.159
<v Speaker 2>twisted together, the noise hits both wires equally. Right, Let's

300
00:14:24.159 --> 00:14:26.200
<v Speaker 2>say it adds ten volts of pure noise, So the

301
00:14:26.240 --> 00:14:28.799
<v Speaker 2>plus one wire becomes plus eleven and the minus one

302
00:14:28.799 --> 00:14:29.879
<v Speaker 2>wire becomes plus nine.

303
00:14:30.039 --> 00:14:32.600
<v Speaker 1>Ah, so both numbers instantly jump up.

304
00:14:32.919 --> 00:14:35.759
<v Speaker 2>They do, but the receiver only cares about the mathematical

305
00:14:35.759 --> 00:14:39.759
<v Speaker 2>difference between them, and eleven minus nine is still two.

306
00:14:39.799 --> 00:14:42.600
<v Speaker 1>The signal is perfectly preserved exactly.

307
00:14:42.960 --> 00:14:46.039
<v Speaker 2>The noise literally cancels itself out. It is an incredibly

308
00:14:46.120 --> 00:14:49.320
<v Speaker 2>robust design. That is exactly why your anti lock breaks

309
00:14:49.320 --> 00:14:52.080
<v Speaker 2>still work perfectly even when your engine is screaming at

310
00:14:52.120 --> 00:14:52.600
<v Speaker 2>the red line.

311
00:14:52.639 --> 00:14:56.120
<v Speaker 1>That is so smart. It's just elegant engineering.

312
00:14:55.679 --> 00:14:57.799
<v Speaker 2>It really is. And there's one more very cool thing

313
00:14:57.799 --> 00:15:01.480
<v Speaker 2>about cambus. Unlike it two C, there is no master controller.

314
00:15:01.879 --> 00:15:03.279
<v Speaker 2>It's entirely peer to peer.

315
00:15:03.720 --> 00:15:06.480
<v Speaker 1>Wait, so who decides who gets to talk? If there's

316
00:15:06.480 --> 00:15:08.720
<v Speaker 1>no master it sounds like it would be chaos.

317
00:15:08.840 --> 00:15:11.679
<v Speaker 2>The priority is actually built directly into the message ID

318
00:15:11.799 --> 00:15:15.159
<v Speaker 2>number itself. If it deploy breaks message and the turn

319
00:15:15.240 --> 00:15:17.879
<v Speaker 2>up radio volume message both try to talk on the

320
00:15:17.919 --> 00:15:20.759
<v Speaker 2>network at the exact same millisecond. The system is physically

321
00:15:20.799 --> 00:15:23.080
<v Speaker 2>designed so that the breaks have a lower ID number,

322
00:15:23.279 --> 00:15:26.279
<v Speaker 2>and on a canvas, a lower number mathematically wins out

323
00:15:26.480 --> 00:15:27.679
<v Speaker 2>and gets higher priority.

324
00:15:27.919 --> 00:15:30.600
<v Speaker 1>That is amazing. The radio automatically just shuts up and

325
00:15:30.600 --> 00:15:31.360
<v Speaker 1>waits yep.

326
00:15:31.679 --> 00:15:34.159
<v Speaker 2>The physics of the wire forced the lower priority message

327
00:15:34.159 --> 00:15:34.720
<v Speaker 2>to back off.

328
00:15:34.919 --> 00:15:38.679
<v Speaker 1>I honestly wish human conversations worked like that, Like important

329
00:15:38.720 --> 00:15:41.759
<v Speaker 1>safety info just mathematically overrides small talk.

330
00:15:42.320 --> 00:15:45.320
<v Speaker 2>It would definitely make office meetings a lot more efficient.

331
00:15:45.759 --> 00:15:48.000
<v Speaker 1>No kidding, Okay, So we had our sensors and we

332
00:15:48.039 --> 00:15:50.879
<v Speaker 1>have the nervous system protocols. Now, let's talk about the brain.

333
00:15:51.440 --> 00:15:55.159
<v Speaker 1>And this is where the book really focuses heavily. We

334
00:15:55.200 --> 00:15:58.519
<v Speaker 1>aren't just talking about normal CPUs here, we are talking

335
00:15:58.519 --> 00:15:59.879
<v Speaker 1>about FPG.

336
00:16:00.519 --> 00:16:03.960
<v Speaker 2>Yes, this is where the engineering gets really interesting. FPGA

337
00:16:04.159 --> 00:16:06.960
<v Speaker 2>stands for field programmable gate array.

338
00:16:07.200 --> 00:16:10.000
<v Speaker 1>Field programmable makes it sound like I can literally fix

339
00:16:10.039 --> 00:16:11.879
<v Speaker 1>it while I'm standing out in a cornfield.

340
00:16:12.000 --> 00:16:14.799
<v Speaker 2>I mean, basically, yes, it means you can completely change

341
00:16:14.840 --> 00:16:17.200
<v Speaker 2>how the physical chip works after it has already been

342
00:16:17.240 --> 00:16:18.840
<v Speaker 2>manufactured and deployed in the field.

343
00:16:19.039 --> 00:16:22.480
<v Speaker 1>How is that fundamentally different from a normal computer processor

344
00:16:22.720 --> 00:16:23.799
<v Speaker 1>like the one in my laptop.

345
00:16:23.919 --> 00:16:26.720
<v Speaker 2>Well, a normal CPU like an Intel or AMD chip

346
00:16:27.279 --> 00:16:31.399
<v Speaker 2>has a totally fixed hardware structure. It is etched in silicon.

347
00:16:31.759 --> 00:16:35.000
<v Speaker 2>It reads software instructions one by one from memory. Add

348
00:16:35.000 --> 00:16:37.519
<v Speaker 2>this number, then move this data, then check this condition.

349
00:16:38.000 --> 00:16:41.440
<v Speaker 2>It operates sequentially right, one step at a time, exactly.

350
00:16:41.919 --> 00:16:45.000
<v Speaker 2>And FPGA, on the other hand, is basically a blank

351
00:16:45.080 --> 00:16:49.840
<v Speaker 2>box of digital lego bricks. Raw logic gates, memory blocks

352
00:16:49.840 --> 00:16:52.960
<v Speaker 2>flip flops. When you program it. You don't write software

353
00:16:52.960 --> 00:16:55.759
<v Speaker 2>that runs on the chip. You write code that literally

354
00:16:55.799 --> 00:16:59.000
<v Speaker 2>rewires the electrical connections between those internal lego bricks.

355
00:16:59.480 --> 00:17:03.080
<v Speaker 1>Wait, I'm physically well electronically changing the actual circuit.

356
00:17:03.159 --> 00:17:06.880
<v Speaker 2>Yes, you are literally creating custom hardware on the fly.

357
00:17:07.200 --> 00:17:09.279
<v Speaker 1>Let's break down those lego bricks you mentioned. The book

358
00:17:09.279 --> 00:17:10.599
<v Speaker 1>talks a lot about logic gates.

359
00:17:10.759 --> 00:17:13.640
<v Speaker 2>Right, These are the fundamental decision makers of the digital world.

360
00:17:13.640 --> 00:17:16.599
<v Speaker 2>You have eighty gates which say if input A andy

361
00:17:16.680 --> 00:17:20.200
<v Speaker 2>input B are true, then do this. You haver gates,

362
00:17:20.680 --> 00:17:23.839
<v Speaker 2>exoor gates, and then you have flip flops, which act

363
00:17:23.880 --> 00:17:26.359
<v Speaker 2>as high speed memory units. They hold a single bit

364
00:17:26.400 --> 00:17:28.559
<v Speaker 2>of data for a split second based on the ticking

365
00:17:28.559 --> 00:17:29.359
<v Speaker 2>of the system clock.

366
00:17:29.440 --> 00:17:31.799
<v Speaker 1>And a single FPGA is just made of millions of

367
00:17:31.839 --> 00:17:33.359
<v Speaker 1>these little gates, millions.

368
00:17:33.079 --> 00:17:35.039
<v Speaker 2>Of them, and because you are wiring them all up

369
00:17:35.079 --> 00:17:38.519
<v Speaker 2>yourself in whatever pattern you need, you unlock the FPGA's

370
00:17:38.839 --> 00:17:43.279
<v Speaker 2>true superpower parallelism. Parallelism that is definitely the key word here.

371
00:17:43.519 --> 00:17:46.799
<v Speaker 2>Think of a standard CPU as a genius level math professor.

372
00:17:47.160 --> 00:17:49.720
<v Speaker 2>He can solve absolutely any problem you give him, but

373
00:17:49.799 --> 00:17:52.640
<v Speaker 2>he can only solve one problem at a time. He

374
00:17:52.720 --> 00:17:57.039
<v Speaker 2>is very fast, but he's working entirely alone. Okay, And

375
00:17:57.200 --> 00:18:00.400
<v Speaker 2>FPGA is more like a giant room flow of ten

376
00:18:00.440 --> 00:18:03.480
<v Speaker 2>thousand middle school students. They might not be as smart

377
00:18:03.480 --> 00:18:07.000
<v Speaker 2>individually as the professor, but they can all solve a specific,

378
00:18:07.319 --> 00:18:09.759
<v Speaker 2>simple problem at the exact same time.

379
00:18:09.960 --> 00:18:12.720
<v Speaker 1>So if I'm processing an image that has a million pixels,

380
00:18:12.799 --> 00:18:15.119
<v Speaker 1>the normal CPU has to look at pixel one, then

381
00:18:15.160 --> 00:18:17.039
<v Speaker 1>pixel two, then pixel three exactly.

382
00:18:17.279 --> 00:18:20.720
<v Speaker 2>Even if it does it fast, it's still sequential. The FPGA, however,

383
00:18:20.799 --> 00:18:22.960
<v Speaker 2>can be wired to look at all one million pixels,

384
00:18:22.960 --> 00:18:26.240
<v Speaker 2>simultaneously process every single one of them, and be completely

385
00:18:26.279 --> 00:18:28.359
<v Speaker 2>done in a single tick of the clock. That is

386
00:18:28.440 --> 00:18:31.400
<v Speaker 2>true hardware acceleration. It's not just about running faster, it's

387
00:18:31.400 --> 00:18:32.480
<v Speaker 2>about doing everything at once.

388
00:18:32.599 --> 00:18:35.519
<v Speaker 1>That honestly blows my mind. But you don't use regular

389
00:18:35.559 --> 00:18:39.039
<v Speaker 1>programming languages like Python or C plus plus to program

390
00:18:39.079 --> 00:18:39.759
<v Speaker 1>these things, do you.

391
00:18:40.000 --> 00:18:42.960
<v Speaker 2>Well? You can use C plus plus with some newer

392
00:18:43.160 --> 00:18:46.720
<v Speaker 2>high level synthesis tools now, which definitely helps. But underneath

393
00:18:46.759 --> 00:18:50.440
<v Speaker 2>it all the native tongue of the FPGA is VHDL

394
00:18:50.599 --> 00:18:53.920
<v Speaker 2>or verolog. These are hardware description languages.

395
00:18:53.960 --> 00:18:54.799
<v Speaker 1>Hardware description.

396
00:18:55.039 --> 00:18:58.240
<v Speaker 2>Right when you type in violog, you aren't writing a

397
00:18:58.279 --> 00:19:01.000
<v Speaker 2>sequential to do list for the computer. You are describing

398
00:19:01.039 --> 00:19:04.079
<v Speaker 2>a physical structure. You are telling the software I need

399
00:19:04.119 --> 00:19:06.640
<v Speaker 2>you to connect this wire to that specific gait.

400
00:19:07.000 --> 00:19:09.759
<v Speaker 1>It's drawing architectural pootprints, not writing a recipe.

401
00:19:09.799 --> 00:19:13.000
<v Speaker 2>Perfectly put, it is hardware design, just done at a keyboard.

402
00:19:13.200 --> 00:19:16.559
<v Speaker 1>So we have this amazing custom hardware brain. But there

403
00:19:16.599 --> 00:19:19.759
<v Speaker 1>is one more massive constraint that Leaden really hammers home

404
00:19:19.759 --> 00:19:22.720
<v Speaker 1>in the book, and that is the concept of real time.

405
00:19:23.000 --> 00:19:26.000
<v Speaker 2>Yes, and this is a concept that is so often misunderstood.

406
00:19:26.480 --> 00:19:30.119
<v Speaker 2>Real time does not just mean really fast. A supercomputer

407
00:19:30.240 --> 00:19:33.480
<v Speaker 2>taking three days to predict the global weather is incredibly fast,

408
00:19:33.680 --> 00:19:36.559
<v Speaker 2>but it's not real time. Real time means computing with

409
00:19:36.640 --> 00:19:38.240
<v Speaker 2>the strict deadline.

410
00:19:37.799 --> 00:19:39.880
<v Speaker 1>A deadline like it has to be done by a

411
00:19:39.880 --> 00:19:40.920
<v Speaker 1>certain millisecond.

412
00:19:41.319 --> 00:19:45.079
<v Speaker 2>The mantra of embedded engineering is the system must be

413
00:19:45.119 --> 00:19:48.759
<v Speaker 2>functionally correct, meaning it gets the right math answer, and

414
00:19:48.839 --> 00:19:51.599
<v Speaker 2>it must be temporarily correct, meaning it gets that answer

415
00:19:51.640 --> 00:19:54.519
<v Speaker 2>at the exact right time. If the right answer arrives late,

416
00:19:55.079 --> 00:19:56.079
<v Speaker 2>it is a wrong answer.

417
00:19:56.359 --> 00:20:01.200
<v Speaker 1>The book distinguishes between hard and soft real time systems.

418
00:20:01.960 --> 00:20:03.039
<v Speaker 1>What are the stakes here?

419
00:20:03.599 --> 00:20:07.480
<v Speaker 2>Soft real time is low stakes. The classic example used

420
00:20:07.599 --> 00:20:09.799
<v Speaker 2>is a car keyfob. You walk up to your car,

421
00:20:09.880 --> 00:20:12.759
<v Speaker 2>you press the unlocked button. If the system takes two

422
00:20:12.759 --> 00:20:15.359
<v Speaker 2>seconds to unlock the door instead of point one seconds,

423
00:20:15.839 --> 00:20:16.640
<v Speaker 2>you might be annoyed.

424
00:20:16.799 --> 00:20:19.240
<v Speaker 1>Right, you might angrily press the button this second time.

425
00:20:19.200 --> 00:20:23.119
<v Speaker 2>Exactly, but the system hasn't catastrophically failed. No one is hurt.

426
00:20:23.240 --> 00:20:28.079
<v Speaker 2>It just lag right. But hard real time think about

427
00:20:28.079 --> 00:20:30.240
<v Speaker 2>the airbag controller in that same car. If you can

428
00:20:30.279 --> 00:20:32.839
<v Speaker 2>do a crash, the sensor detects the sudden impact, the

429
00:20:32.839 --> 00:20:35.279
<v Speaker 2>processor has to calculate the force and physically fire the

430
00:20:35.279 --> 00:20:38.160
<v Speaker 2>air bag. If that system deploys the air bag even

431
00:20:38.160 --> 00:20:39.640
<v Speaker 2>one hundred milliseconds.

432
00:20:39.119 --> 00:20:42.200
<v Speaker 1>Too late, it's entirely useless. Or even worse, it deploys

433
00:20:42.279 --> 00:20:44.319
<v Speaker 1>right as your head is moving forward and actually hurts

434
00:20:44.359 --> 00:20:45.279
<v Speaker 1>you exactly.

435
00:20:45.279 --> 00:20:49.359
<v Speaker 2>That is a total system failure. In hard real time engineering,

436
00:20:49.799 --> 00:20:52.640
<v Speaker 2>missing the deadline by a fraction of a second is

437
00:20:52.720 --> 00:20:55.839
<v Speaker 2>literally the exact same thing as the computer completely crashing.

438
00:20:56.079 --> 00:20:58.400
<v Speaker 1>This has to create a huge challenge for the programmer,

439
00:20:58.440 --> 00:21:01.759
<v Speaker 1>doesn't it. Because the process is usually doing a dozen

440
00:21:01.799 --> 00:21:03.960
<v Speaker 1>things at once. It has to check the sensors, It

441
00:21:04.000 --> 00:21:06.920
<v Speaker 1>has to update the dashboard display, it has to talk

442
00:21:06.960 --> 00:21:10.279
<v Speaker 1>to the CAN network. How do you guarantee that the

443
00:21:10.319 --> 00:21:11.960
<v Speaker 1>life or death stuff happens first?

444
00:21:12.319 --> 00:21:15.000
<v Speaker 2>That is known as the scheduling challenge, and the book

445
00:21:15.039 --> 00:21:18.240
<v Speaker 2>discusses this in great detail. I imagine you have an

446
00:21:18.279 --> 00:21:22.079
<v Speaker 2>electric motor that needs its voltage adjusted fifty times every

447
00:21:22.119 --> 00:21:25.160
<v Speaker 2>single second, so fifty hertz, just to run smoothly without

448
00:21:25.160 --> 00:21:28.359
<v Speaker 2>burning out. But the processor also has a display screen

449
00:21:28.720 --> 00:21:30.559
<v Speaker 2>that it needs to update ten times a second.

450
00:21:30.599 --> 00:21:32.680
<v Speaker 1>And if the display update takes just a little bit

451
00:21:32.680 --> 00:21:34.559
<v Speaker 1>too long to draw the graphics.

452
00:21:34.039 --> 00:21:36.559
<v Speaker 2>The motor doesn't get its critical voltage adjustment on time.

453
00:21:36.920 --> 00:21:40.640
<v Speaker 2>The motor physically stutters. In the industry, that's called jitter. Yeah,

454
00:21:40.680 --> 00:21:43.680
<v Speaker 2>and jitter is the absolute enemy of real time systems.

455
00:21:43.839 --> 00:21:46.440
<v Speaker 1>Jitter just the word makes me anxious. So how do

456
00:21:46.519 --> 00:21:47.400
<v Speaker 1>engineers fix it?

457
00:21:47.680 --> 00:21:51.039
<v Speaker 2>The standard solution is using an RCOs, a real time

458
00:21:51.119 --> 00:21:54.920
<v Speaker 2>operating system. It's a highly specialized operating system that acts

459
00:21:54.960 --> 00:21:58.559
<v Speaker 2>like a completely ruthless traffic cop. Yeah. It manages all

460
00:21:58.640 --> 00:22:02.160
<v Speaker 2>the system priorities using some they called preemptive multitasking.

461
00:22:02.240 --> 00:22:06.039
<v Speaker 1>Preemptive meaning just violently interrupts whatever is happening ruthlessly.

462
00:22:06.680 --> 00:22:09.640
<v Speaker 2>If the motor control task suddenly says, hey, it's my

463
00:22:09.799 --> 00:22:13.359
<v Speaker 2>exact millisecond I need to run right now, the RTOS

464
00:22:13.400 --> 00:22:17.359
<v Speaker 2>instantly pauses the display update task right in the middle

465
00:22:17.359 --> 00:22:20.279
<v Speaker 2>of drawing a pixel. Let's the motor code run, and

466
00:22:20.319 --> 00:22:23.160
<v Speaker 2>then it resumes the display. It doesn't ask permission. It

467
00:22:23.200 --> 00:22:26.319
<v Speaker 2>absolutely ensures the heart deadlines are met, even if the

468
00:22:26.359 --> 00:22:29.440
<v Speaker 2>soft deadlines have to wait a microsecond. M Wow.

469
00:22:29.839 --> 00:22:32.440
<v Speaker 1>Okay, So bringing this all together, we have gone on

470
00:22:32.559 --> 00:22:35.039
<v Speaker 1>quite a journey here. We start from a physical change

471
00:22:35.079 --> 00:22:37.880
<v Speaker 1>out in the real world, a temperature rise or a

472
00:22:37.920 --> 00:22:41.000
<v Speaker 1>brake pedal being pressed. Right, that physical change becomes an

473
00:22:41.039 --> 00:22:44.799
<v Speaker 1>electrical signal through a sensor. The ADC translates that analog

474
00:22:44.839 --> 00:22:48.279
<v Speaker 1>wave into digital numbers. Then those protocols, the ITCDESPI, the

475
00:22:48.359 --> 00:22:51.160
<v Speaker 1>can bus zip that data safely through the nervous system.

476
00:22:51.640 --> 00:22:54.960
<v Speaker 1>It finally lands in a processor, maybe an FPGA, which

477
00:22:55.039 --> 00:22:58.400
<v Speaker 1>might literally be physically rewired just to handle that specific

478
00:22:58.440 --> 00:23:02.240
<v Speaker 1>data perfectly. All all of this is happening under a microscopic,

479
00:23:02.480 --> 00:23:06.240
<v Speaker 1>strict deadline managed by a ruthless RTOS.

480
00:23:06.519 --> 00:23:08.880
<v Speaker 2>Honestly, when you summarize it all put together like that

481
00:23:09.160 --> 00:23:11.319
<v Speaker 2>is kind of a miracle that anything in our modern

482
00:23:11.359 --> 00:23:12.319
<v Speaker 2>world works at all.

483
00:23:12.400 --> 00:23:14.920
<v Speaker 1>It really is. It completely changes how you look at

484
00:23:14.920 --> 00:23:17.160
<v Speaker 1>everyday things. When I go out and unlock my car

485
00:23:17.240 --> 00:23:19.440
<v Speaker 1>door today, I'm not just opening a door. I am

486
00:23:20.119 --> 00:23:25.599
<v Speaker 1>triggering a massive, silent symphony of physics, electrical engineering, digital logic,

487
00:23:25.759 --> 00:23:26.960
<v Speaker 1>and perfect timing.

488
00:23:27.160 --> 00:23:29.880
<v Speaker 2>And that is the true AHA moment for me. When

489
00:23:29.920 --> 00:23:31.920
<v Speaker 2>studying this stuff. We look at a car or a

490
00:23:32.000 --> 00:23:34.799
<v Speaker 2>smartphone and we just see a single solid object. But

491
00:23:34.920 --> 00:23:37.640
<v Speaker 2>underneath the metal and glass. It's actually a high speed

492
00:23:37.680 --> 00:23:42.400
<v Speaker 2>conversation between hundreds of tiny specialized computer systems, all shouting

493
00:23:42.400 --> 00:23:43.880
<v Speaker 2>at each other in perfect synchronization.

494
00:23:44.359 --> 00:23:46.599
<v Speaker 1>Before we wrap up today, I really want to leave

495
00:23:46.680 --> 00:23:49.880
<v Speaker 1>you the listener with a provocative thought that struck me

496
00:23:50.039 --> 00:23:53.480
<v Speaker 1>while reading the source material about FPGAs. We are so

497
00:23:53.640 --> 00:23:57.519
<v Speaker 1>used to the idea that hardware is hard it's the physical,

498
00:23:57.759 --> 00:24:01.960
<v Speaker 1>unchangeable silicon chip, and that software is soft it's the

499
00:24:01.960 --> 00:24:03.359
<v Speaker 1>code you can easily update.

500
00:24:03.559 --> 00:24:04.839
<v Speaker 2>Right, That's the classic divide.

501
00:24:04.839 --> 00:24:09.079
<v Speaker 1>But with FPGAs we are literally rewriting the physical circuit

502
00:24:09.160 --> 00:24:12.359
<v Speaker 1>layout on the fly, we are downloading hardware.

503
00:24:12.720 --> 00:24:14.720
<v Speaker 2>It raises a really fascinating question.

504
00:24:14.480 --> 00:24:17.119
<v Speaker 1>About the future, right, like, where does the line between

505
00:24:17.160 --> 00:24:20.000
<v Speaker 1>hardware and software actually exist anymore? If I can just

506
00:24:20.039 --> 00:24:22.640
<v Speaker 1>download a file from the Internet that fundamentally changes the

507
00:24:22.640 --> 00:24:26.319
<v Speaker 1>physical electrical pathways of my computer chip, essentially downloading an

508
00:24:26.440 --> 00:24:29.920
<v Speaker 1>entirely new computer architecture over Wi Fi, are we entering

509
00:24:29.920 --> 00:24:32.599
<v Speaker 1>an arrow where the hardware itself is just as fluid

510
00:24:32.599 --> 00:24:34.599
<v Speaker 1>and temporary as the code running on top of it.

511
00:24:34.680 --> 00:24:37.720
<v Speaker 2>That is the absolute frontier of embedded design, And as

512
00:24:37.720 --> 00:24:40.680
<v Speaker 2>these systems get more connected and more complex, that dividing

513
00:24:40.680 --> 00:24:43.079
<v Speaker 2>line is only going to get blurrier and blurrier. The

514
00:24:43.200 --> 00:24:46.359
<v Speaker 2>rigid static hardware of the past is very quickly becoming

515
00:24:46.359 --> 00:24:46.839
<v Speaker 2>a memory.

516
00:24:47.200 --> 00:24:49.799
<v Speaker 1>Definitely something to mull over the next time you are

517
00:24:49.880 --> 00:24:52.599
<v Speaker 1>standing in the bathroom waiting for your smart toothbrush to

518
00:24:52.599 --> 00:24:56.279
<v Speaker 1>perform a firmware update exactly Well, that is it for

519
00:24:56.359 --> 00:25:00.359
<v Speaker 1>this deep dive into the invisible infrastructure of our life vibes.

520
00:25:00.519 --> 00:25:01.519
<v Speaker 1>Thanks so much for listening.
