YouTube2Text

W1 Introduction EN — Transcript

by Hasan Erdem Yantır · 17,664 words · 3,095 segments · language en · Watch on YouTube

Full transcript

  1. 0:03So, the class is about risk five
  2. 0:06architecture and processor design.
  3. 0:09And my name is Hassan Adam Yantar.
  4. 0:12I will introduce myself. This class is
  5. 0:14about
  6. 0:16a top-to-bottom understanding of a
  7. 0:18modern risk five processor system.
  8. 0:20So, in this class we will see how to
  9. 0:22design a very complex processor
  10. 0:25core, but not not the SOC itself. In
  11. 0:28here there is a die shot of Apple M4.
  12. 0:31And you you see there are different
  13. 0:33kinds of components in this die shot.
  14. 0:36You know, Apple Apple is the phone that
  15. 0:38you use
  16. 0:40commonly. And its processor consists of
  17. 0:43different components like GPUs, CPUs.
  18. 0:46And in this course we are going to focus
  19. 0:48on the CPU. And we will focus on the
  20. 0:50complex processor.
  21. 0:52Complex CPU.
  22. 0:55Not like the basic ones.
  23. 0:58And I will introduce it more in detail.
  24. 1:00I will mention about it in detail. My
  25. 1:03name is Hassan Adam Yantar. Actually,
  26. 1:04I'm a senior chief research researcher
  27. 1:07at the BİLGEM. And also at the same time
  28. 1:09I'm a part-time faculty at Istanbul
  29. 1:11Technical University. In the case of a
  30. 1:13need, you can contact me over this
  31. 1:15email.
  32. 1:18In here I mentioned that I mentioned
  33. 1:21about the term named risk five. And risk
  34. 1:24five is actually an instruction set
  35. 1:25architecture. And instruction set
  36. 1:27architecture defines how the CPU is
  37. 1:29controlled by the software.
  38. 1:32So, it's like a common language between
  39. 1:34the hardware and software. So, when you
  40. 1:37look at this picture,
  41. 1:39everything is consists of physics
  42. 1:41devices.
  43. 1:42And these devices combines and forms the
  44. 1:45digital circuits, analog circuits. And
  45. 1:47we have logic
  46. 1:49based on these digital circuits,
  47. 1:50microarchitecture, architecture, and
  48. 1:52application software through the
  49. 1:55top level application software.
  50. 1:58And when you look at any
  51. 2:01electronic component, for example, a
  52. 2:04processor, you are writing software on
  53. 2:06it, running software on it. Uh it's
  54. 2:09Okay, people are using it to write
  55. 2:11software, but under under the software,
  56. 2:14there are lots of different levels.
  57. 2:17Starting from physics until the
  58. 2:19architecture.
  59. 2:20And in here, you know, people they are
  60. 2:23writing the software, and also also
  61. 2:25there are also other people they are
  62. 2:27building the micro processor. And there
  63. 2:30should be a common language between
  64. 2:31them. Because the the one who is writing
  65. 2:34the software needs to know that
  66. 2:36how which software, how how should it
  67. 2:39write the software for this
  68. 2:41architecture? And at the same time, the
  69. 2:44hardware developer needs to know that
  70. 2:47under which software commands my
  71. 2:49hardware should should run them.
  72. 2:52So,
  73. 2:53instruction set architecture plays a key
  74. 2:55role in here. So, as I told you, it's a
  75. 2:58common language between the hardware and
  76. 3:00software.
  77. 3:02So,
  78. 3:04in here, there are two terms where the
  79. 3:06which are important. One of them is
  80. 3:08architecture.
  81. 3:09Architecture is the programmer's view of
  82. 3:11a computer.
  83. 3:13Uh like instruction, operand locations,
  84. 3:16like and or for example, operands. And
  85. 3:19microarchitecture is related to how to
  86. 3:22implement an architecture in hardware.
  87. 3:25So, as I told, instruction set
  88. 3:26architecture is the common language
  89. 3:28between the hardware developers and
  90. 3:30software developers.
  91. 3:33Uh Otherwise, we don't know. For
  92. 3:34example, when you write a software for
  93. 3:36the Intel,
  94. 3:37you cannot run it in on a ARM processor.
  95. 3:41Uh For this reason, there should be a
  96. 3:42common language, which is named as
  97. 3:44instruction set architecture.
  98. 3:49Is it clear? Did you understand that
  99. 3:51what
  100. 3:52instruction set architecture is? Okay.
  101. 3:55Instruction set archi-
  102. 3:57Now in the modern world, there are two
  103. 4:02instruction set architecture classes.
  104. 4:04One of them is RISC and other one is the
  105. 4:06CISC.
  106. 4:07So, they are classified into categories
  107. 4:10mainly. There are different instruction
  108. 4:12set architectures, but they are not
  109. 4:13common. They are not used much.
  110. 4:15And in RISC and CISC classes, there are
  111. 4:18lots of different variants of it.
  112. 4:22In this class, we are going to focus on
  113. 4:23RISC-based instruction set architecture,
  114. 4:26which is RISC-V.
  115. 4:27When you compare it,
  116. 4:30for example, in RISC,
  117. 4:33it stands for reduced instruction set
  118. 4:35computing.
  119. 4:37Its instructions are basic, simple.
  120. 4:42And it generates if you compile a code
  121. 4:45written code written, for example, in C,
  122. 4:48C++, or C#, when you compile it, it
  123. 4:50generates higher code size. This is a
  124. 4:53negative effect. But it's it's this
  125. 4:57processors, if you implement a processor
  126. 5:00that runs the RISC programs, it is
  127. 5:02its area and power consumption is less.
  128. 5:05Area is less, also power consumption is
  129. 5:07less. So, it is area and power
  130. 5:09efficient. And these RISC-based
  131. 5:11architectures are good for mobile and
  132. 5:13also for high-performance computing like
  133. 5:16desktop and laptop, it is also
  134. 5:18extending.
  135. 5:20So, it can perform better also.
  136. 5:22CISC is It is used mainly by Intel and
  137. 5:27AMD.
  138. 5:28It stands for complex instruction set
  139. 5:30computing.
  140. 5:32It has It consists of the advanced and
  141. 5:34complex instructions. When you compile a
  142. 5:36program
  143. 5:37by using CISC compilers, it generates
  144. 5:40lower code size, but its processors are
  145. 5:43very complex and power-hungry.
  146. 5:46These instruction set architecture good
  147. 5:48for high performance computing, but
  148. 5:50definitely not for mobile. And the good
  149. 5:53thing is that
  150. 5:55uh which is for for risk that we will
  151. 5:58see in this lecture in this class. Uh
  152. 6:00risk is also extending to the high
  153. 6:02performance computing. For example, when
  154. 6:04you look at the Apple uh the laptops,
  155. 6:07Apple was selling the laptops with x86
  156. 6:10uh
  157. 6:11and
  158. 6:12uh nowadays for the last 4 years, they
  159. 6:15start to ship also laptops with the risk
  160. 6:17processors, arm processors.
  161. 6:20When you look at the instruction set
  162. 6:22architectures, you I mentioned about the
  163. 6:25CISC. CISC is the actually the
  164. 6:29CISC belongs to AMD and Intel. It is
  165. 6:32x86. Okay, at it also has 64 variants.
  166. 6:36And when you look at the RISC side RISC
  167. 6:37side, there is RISC-V and arm.
  168. 6:41Uh arm is commercial. Uh there are two
  169. 6:44mainly two RISC instruction set
  170. 6:46architectures. One of them is RISC-V and
  171. 6:49arm. And arm is commercial. So, for
  172. 6:51example, you you can read the arm
  173. 6:53documents, but you cannot use this
  174. 6:57instruction set architecture arm
  175. 6:59instruction set architecture both the
  176. 7:00commercial one.
  177. 7:02Uh
  178. 7:02so,
  179. 7:03otherwise if you want to use it, you
  180. 7:05need to pay money to arm.
  181. 7:08It is proprietary. Uh so,
  182. 7:10and in here other one is alternative is
  183. 7:13RISC-V. RISC-V is open set instruction
  184. 7:15set architecture. It is like Linux.
  185. 7:18It is the hardware version of Linux.
  186. 7:20Linux is a open source operating system.
  187. 7:24Uh
  188. 7:25and RISC-V
  189. 7:26in software, of course Linux is
  190. 7:28software. RISC-V is like open source
  191. 7:30hardware.
  192. 7:32You can think about think so.
  193. 7:35So, in in this class, that's why the
  194. 7:37reason is that RISC-V is free and open
  195. 7:39source. We are going to focus on the
  196. 7:41risk five instruction set architecture,
  197. 7:43but mainly you can apply for example in
  198. 7:46this class we will see the complex
  199. 7:48processor architectures and you can
  200. 7:49apply it to other processor
  201. 7:52instruction set architecture also. You
  202. 7:54can use this methodologies to build a
  203. 7:56processor by using army instruction set
  204. 7:58architecture also.
  205. 8:03RISC-V, why we are seeing RISC-V?
  206. 8:05RISC-V is
  207. 8:07nowadays going very well.
  208. 8:10Its usage are increasing.
  209. 8:13In in the countries like for example
  210. 8:15China
  211. 8:16and other some European countries
  212. 8:19which are which they don't have any
  213. 8:22processor national processor, they are
  214. 8:24exploiting the RISC-V to build their own
  215. 8:26national processor because it is open
  216. 8:28source. There is a very huge open source
  217. 8:30community supporting this process
  218. 8:33instruction set architecture.
  219. 8:35For for this reason, it is global market
  220. 8:37is increasing
  221. 8:39very rapidly.
  222. 8:41And you can use it in many different
  223. 8:43domains.
  224. 8:45So,
  225. 8:47in overall nowadays, ASIC and in FPGA
  226. 8:50projects, 28 23% of those projects are
  227. 8:54using at least a single RISC-V core and
  228. 8:56it is increasing very rapidly.
  229. 8:59So,
  230. 9:01as for most of us as Turkish, if you
  231. 9:04want to build a national processor,
  232. 9:07then the RISC-V is the only choice. And
  233. 9:10we need to exploit the RISC-V.
  234. 9:12Otherwise, for example, we can okay read
  235. 9:15Intel's document and
  236. 9:17build a x86 processor,
  237. 9:20but we have to pay money to Intel or may
  238. 9:23not be sell.
  239. 9:25Most most likely they will not sell it
  240. 9:27sell it to us.
  241. 9:28And for the arm also, we need to pay to
  242. 9:31arm. But for if you are using RISC-V,
  243. 9:33there is a very huge open source
  244. 9:35community. They are supporting you.
  245. 9:38And its performance also increasing day
  246. 9:41by day. So, there is a good opportunity
  247. 9:45in RISC-V instruction set. So,
  248. 9:49it's very important. That's why we are
  249. 9:50opening this offering this class.
  250. 9:54And these lectures are just to
  251. 9:57introduce. These slides are just to
  252. 9:59introduce you instruction set
  253. 10:01architecture, what RISC-V is.
  254. 10:03Is it clear?
  255. 10:05You can ask in Turkish also. I can
  256. 10:07answer in in English.
  257. 10:11Okay.
  258. 10:14So, the course is about digital design.
  259. 10:18Yeah, I will mention about the course
  260. 10:19content.
  261. 10:20First, we will see digital design
  262. 10:23overview and system Verilog. And after
  263. 10:26that, we will start to look at RISC-V
  264. 10:28instruction set architecture. And after
  265. 10:31that, we are going to see the basic
  266. 10:34processor architectures in order ones,
  267. 10:36single cycle and pipeline in order ones.
  268. 10:39And after that, we will see caches and
  269. 10:41memory. We will
  270. 10:43look at the branch prediction. And after
  271. 10:45that, we will switch to out-of-order
  272. 10:47course. This is the important topic. I
  273. 10:49think this is the most
  274. 10:52beneficial content of this course.
  275. 10:56And after that, we will see some some
  276. 10:58information about the virtual memory and
  277. 11:00operating system, how to run
  278. 11:02operating system in an accord.
  279. 11:04And if we can find time, we will look at
  280. 11:07the SOC. We will look at the
  281. 11:09interconnect, peripherals, and GPU as
  282. 11:12empty and vector course.
  283. 11:14So, in overall, our aim is that, for
  284. 11:17example, in here, there is I put another
  285. 11:20Apple processor die shot. And in here,
  286. 11:23you can see the course. We I would like
  287. 11:26to show you how to build such a complex
  288. 11:28core.
  289. 11:30Of course, we will not be able to do it,
  290. 11:32but at least you will have a imagination
  291. 11:34that how can we build it. Maybe we can
  292. 11:37come together as a team, 30 40 people,
  293. 11:40we we will be able to build it. But at
  294. 11:43least you can
  295. 11:46imagine native.
  296. 11:48You can imagine
  297. 11:50how to build it.
  298. 11:52So, for example, you can see that in the
  299. 11:54internet, people are saying that okay,
  300. 11:56we are building this five course, but
  301. 11:58these are generally very very basic risk
  302. 12:00five course.
  303. 12:01For example, there is a competition
  304. 12:03Technofest chip design competition. And
  305. 12:06in this competition, people are
  306. 12:07designing risk five processor. They are
  307. 12:09very very small actually. They are not
  308. 12:11realistic. They are basic. Like for
  309. 12:13example, in this for example, projector
  310. 12:15controller, remote controller.
  311. 12:17Inside this remote controller, there is
  312. 12:20a small processor. It is just
  313. 12:23looking to the push buttons,
  314. 12:26sensing them, and sending the commands
  315. 12:27to the projector.
  316. 12:30You can use such processors in this
  317. 12:32remote controller, but not for high
  318. 12:34performance computing or in laptop.
  319. 12:37Inshallah, in our class, our aim is to
  320. 12:40look
  321. 12:41design complex processors.
  322. 12:45At least just to imagine how to build
  323. 12:46it.
  324. 12:51And in this class,
  325. 12:53you remember this picture of hierarchy.
  326. 12:56We will focus digital circuits, logic,
  327. 12:59micro architecture architecture and a
  328. 13:01little bit operating systems. In this
  329. 13:03class, of course, you have to know the
  330. 13:05knowledge of the digital circuits. At
  331. 13:06least you you took classes on second and
  332. 13:10third years. So, you need to know some
  333. 13:13information about digital circuits,
  334. 13:15but
  335. 13:17we we mainly in this class focus on the
  336. 13:20micro architecture and architecture.
  337. 13:23This is the course
  338. 13:26logistics information. In this course
  339. 13:31for 35% of the overall grade, we will do
  340. 13:35in-class quizzes.
  341. 13:36I will give seven quizzes in total and
  342. 13:39select highest five of them
  343. 13:41for grading.
  344. 13:43We will do one midterm exam, 25%, one
  345. 13:46final exam, 40%, and I will give you six
  346. 13:50homeworks, but it is optional. You don't
  347. 13:52You don't have to do it.
  348. 13:55So,
  349. 13:56the
  350. 13:58for advice for success in this course,
  351. 14:01just focus on learning,
  352. 14:03uh
  353. 14:04manage time, follow schedules, and don't
  354. 14:06postpone. In the case of a
  355. 14:09need, ask questions, even if it is
  356. 14:11basic. So, it is By the way, it is
  357. 14:14better for me to to this class
  358. 14:16interactive.
  359. 14:17I know it is a little bit hard in
  360. 14:19English, but we can try. Also, you are
  361. 14:22free to speak in Turkish, uh but if you
  362. 14:24can make the class interactive, I think
  363. 14:26it is much better. In here, I I put two
  364. 14:29proverbs. You can read it. It is
  365. 14:32unfortunately in in Turkish, uh but it
  366. 14:35says that
  367. 14:37free time is important. You need to
  368. 14:38evaluate it.
  369. 14:40And also,
  370. 14:42you need to also need evaluate or uh
  371. 14:46get the benefit from the uh free time
  372. 14:49before becoming busy.
  373. 14:53Uh what about the AI policy? You can use
  374. 14:57AI freely.
  375. 15:00No problem. Not in class, by the way.
  376. 15:01Not during the quizzes.
  377. 15:03Uh you can use
  378. 15:05large language models freely for
  379. 15:07learning, but it can easily mislead you
  380. 15:09if you expect more, because we are using
  381. 15:11it in our also in TUBITAK
  382. 15:14while we are building the complex ICs.
  383. 15:18Uh they are actually
  384. 15:20don't yield the best result. They are
  385. 15:22not giving the best results, maybe
  386. 15:24intentionally by the way, because for
  387. 15:25example, think about people for example,
  388. 15:28America is
  389. 15:29building a model large large language
  390. 15:31model.
  391. 15:32And you are asking this model how to
  392. 15:36gen- how to build a very super high
  393. 15:39performance respect
  394. 15:41processor.
  395. 15:42Uh do you think that
  396. 15:44does it give you the correct answer?
  397. 15:46Sometimes they are
  398. 15:48under performing performing
  399. 15:50intentionally. I know because one friend
  400. 15:53was working for these companies. For
  401. 15:55example, if you are asking for
  402. 15:58very
  403. 15:59for example, uh
  404. 16:01high-end questions,
  405. 16:04uh they are not answering uh
  406. 16:07fully. They are
  407. 16:09under performing.
  408. 16:12So, they are not explicitly answering
  409. 16:13everything.
  410. 16:16So, they are not yielding the best
  411. 16:18results may and most likely it is
  412. 16:20intentionally,
  413. 16:21uh but of course, you can use the LLMs
  414. 16:23for learning. So, you can ask for
  415. 16:25example,
  416. 16:26in the next phases of the courses, for
  417. 16:28example, you can ask LLMs how renaming
  418. 16:31works, for example, and you can check
  419. 16:33it. Uh
  420. 16:36Why we are not giving any homeworks?
  421. 16:39Because LLMs can do the basic RTL design
  422. 16:42tasks.
  423. 16:43Uh this is the fourth time we are
  424. 16:45offering this course, and in the in the
  425. 16:47first semester, in the first offering,
  426. 16:49it
  427. 16:50it was not able to do it.
  428. 16:53But day by day, uh they are progressing.
  429. 16:57Uh they are improving themselves, and in
  430. 16:58the last semester, we realized that most
  431. 17:01of the students are doing the homeworks
  432. 17:02by using the LLMs, and they are not
  433. 17:04learning. This was the problem. That's
  434. 17:07why homeworks are not graded. We will
  435. 17:09give it, but it is optional.
  436. 17:11Uh so, this is the new grading actually,
  437. 17:14starting from this semester.
  438. 17:19And the important point in here is that
  439. 17:21quizzes will be related to homeworks.
  440. 17:23So, working on the homeworks is still
  441. 17:25beneficial.
  442. 17:31At the beginning I mentioned that
  443. 17:33I am coming from TUBITAK
  444. 17:35and working for ITU as part-time.
  445. 17:40As TUBITAK,
  446. 17:41I am working for the integrated circuit
  447. 17:43design and training laboratory. We
  448. 17:45conduct research and teaching
  449. 17:47activities, but as
  450. 17:50employee in TUBITAK, as a researcher in
  451. 17:52TUBITAK, we conduct research and
  452. 17:53teaching activities at Istanbul
  453. 17:55Technical University because I am also
  454. 17:56at the same time part-time faculty in
  455. 17:58here.
  456. 17:59So, in here we are offering graduation
  457. 18:02projects. This is like
  458. 18:04a slide for advertisement.
  459. 18:06We are offering graduation projects.
  460. 18:09We have master and PhD students in here.
  461. 18:12Also, in TUBITAK we are offering
  462. 18:14internship and fellowship. By the way,
  463. 18:16in digital domain, for example,
  464. 18:19around 60% of the researchers graduated
  465. 18:22from this course in in my team, in my
  466. 18:25research team.
  467. 18:26So, this course is actually beneficial
  468. 18:29for your for your requirement
  469. 18:31in TUBITAK.
  470. 18:35And also we are offering two courses as
  471. 18:38TUBITAK. One of them is this course.
  472. 18:41This course is named as RISC-V
  473. 18:43architecture and processor design, but
  474. 18:45starting from the next semester we will
  475. 18:47make it EHB course,
  476. 18:50inshallah, hopefully. And it will be
  477. 18:52named as processor architecture and
  478. 18:54design. And in this course, it is a the
  479. 18:57content will be the same. So, we will
  480. 18:59see RTL implementation of a complex
  481. 19:02high-performance processor architecture.
  482. 19:04And after this course, we will offer
  483. 19:07this course during in the spring
  484. 19:09semesters, and in the fall semesters we
  485. 19:12are going to offer the associate design
  486. 19:14and physical implementation course. And
  487. 19:16in this course, we are going to
  488. 19:17physically implement the processor that
  489. 19:20processors that we designed in the
  490. 19:22previous course.
  491. 19:23So, in this course, we will focus on the
  492. 19:25associate design and physical
  493. 19:26implementation at TSMC 16 nanometer
  494. 19:29technology.
  495. 19:33So, this course will be
  496. 19:35about the design and the next course
  497. 19:37will be about the physical
  498. 19:39implementation and associate design.
  499. 19:41Because
  500. 19:42in this course, we are mainly we focus
  501. 19:44on the core of a processor. Uh but core
  502. 19:48itself is not much meaningful. You need
  503. 19:51to build a associate system because for
  504. 19:54example, you are
  505. 19:55In the next lectures, we will see in
  506. 19:57detail, but
  507. 19:58if you build a core processor core, of
  508. 20:01course, you need to for example, connect
  509. 20:03screen to this core,
  510. 20:05uh keyboard to this core. So, associate
  511. 20:07environment is the place that you are
  512. 20:10connecting these peripherals to this
  513. 20:12core. So, it is also very important. Uh
  514. 20:14actually, associate is providing you to
  515. 20:16methodology to interact with the outside
  516. 20:18world. Core itself is not enough.
  517. 20:21Core is the like brain, but you need
  518. 20:23hands also at the same time. Like
  519. 20:29Any question?
  520. 20:42Yes.
  521. 20:44So, before starting to the class, I will
  522. 20:47mention a little bit about integrated
  523. 20:50circuits and its importance also.
  524. 20:54Uh so, as you know, integrated circuit
  525. 20:56consists of transistors.
  526. 20:58Uh in here, we have a For example, this
  527. 21:00is a transistor. It's like
  528. 21:02uh a switch.
  529. 21:04Uh
  530. 21:06If you
  531. 21:08apply a voltage to the gate, it passes
  532. 21:11current. And if you don't apply, it's
  533. 21:14just
  534. 21:15not pass the current.
  535. 21:19So, with the advent of the technology in
  536. 21:21the technology, these
  537. 21:24transistors can be built in a very small
  538. 21:26dimensions, like 14 nanometer.
  539. 21:30So, compared for example, you can build
  540. 21:32a transistor and its size can be for
  541. 21:34example, like 7 nanometer, 10 nanometer.
  542. 21:36It can be very, very small.
  543. 21:38So, compared to human hair, which is
  544. 21:41around 90,000 nanometer thickness,
  545. 21:44uh you can fit maybe
  546. 21:47thousands of them inside a human hair.
  547. 21:50So, by combining these transistors,
  548. 21:54we are building the logic gates and
  549. 21:56unlock devices. For example, in here,
  550. 21:59there is a basic AND gate.
  551. 22:01And you can think that it consists of
  552. 22:03six transistors. When you compute its
  553. 22:05area, it's very small.
  554. 22:08Like for example, 100 nanometer, you we
  555. 22:11can say. So, it is
  556. 22:13in a 100 nanometer square meter for
  557. 22:16example, you can build very simple logic
  558. 22:18gate that can perform the AND gate. And
  559. 22:21by using these AND gates and combining
  560. 22:24them, we are building more complex
  561. 22:26circuits like adders, multipliers.
  562. 22:30And at the same time, analog devices are
  563. 22:32also built by using just transistor.
  564. 22:35Of course, analog can also use inductor
  565. 22:38and other components.
  566. 22:40And then by using these very tiny
  567. 22:43transistors and combining billions of
  568. 22:46them, we are building the integrated
  569. 22:48circuits.
  570. 22:51And in terms of the signal, there are
  571. 22:54two domains, as you know. One of them is
  572. 22:57analog domain and one of them is digital
  573. 22:58domain. Digital domain is like
  574. 23:00abstraction of the domain. Analog is
  575. 23:02continuous,
  576. 23:03like 0, 0.1, 0.2, 0.375
  577. 23:07V,
  578. 23:08but digital is between two values. It's
  579. 23:11abstract version of the analog. This is
  580. 23:13one or zero. And all processors works as
  581. 23:17digital.
  582. 23:18So, in this class we are going to focus
  583. 23:20on the digital domain.
  584. 23:23How we are building digital or
  585. 23:25mixed-signal integrated circuits?
  586. 23:28In here, I will mention briefly.
  587. 23:30Normally, it is impossible. For example,
  588. 23:33one one CPU consists of maybe a billion
  589. 23:36of transistors, and it is impossible to
  590. 23:38connect them by hand.
  591. 23:40So, generally we write
  592. 23:43hardware
  593. 23:45We write actually code to to describe
  594. 23:47the processor.
  595. 23:49And this is named as hardware
  596. 23:51description languages.
  597. 23:54And after writing this hardware
  598. 23:56description languages, we are synthesize
  599. 23:58it. It's like compilation. We compile
  600. 24:01it.
  601. 24:02And after that, after the compilation,
  602. 24:05we convert it in a format that can be
  603. 24:09fabricated physically.
  604. 24:11So, we are converting it into in a
  605. 24:13physical format.
  606. 24:15At the same time, if you want, you can
  607. 24:17put
  608. 24:18analog circuits inside.
  609. 24:21And build a mixed-signal integrated
  610. 24:24circuit, digital or mixed-signal
  611. 24:25integrated circuit. But, the important
  612. 24:27point in here is that
  613. 24:29you are not building the processor by
  614. 24:32combining billion of transistors. You
  615. 24:34are just writing code. We are describing
  616. 24:37the processor by writing code.
  617. 24:44And after this compilation, you can
  618. 24:46think it as a compilation.
  619. 24:48After com After these steps, you can
  620. 24:51send it to the fabrication and produce
  621. 24:53the chip. This is the digital or
  622. 24:55mixed-signal integrated circuit design
  623. 24:57flow in general.
  624. 24:59Uh what about analog integrated circuit
  625. 25:01design? In analog integrated circuit, we
  626. 25:03are still using transistors, but this
  627. 25:06time we are designing it by hand. We are
  628. 25:09putting the transistors and shaping
  629. 25:11them. For example, specifying its
  630. 25:13dimensions. We are connecting them.
  631. 25:16And
  632. 25:17after that, we are writing We are making
  633. 25:20it ready for the
  634. 25:21production and sending it to the
  635. 25:23fabrication for fabrication and getting
  636. 25:26the chip.
  637. 25:30The difference is that mainly in digital
  638. 25:32integrated circuit design, we are
  639. 25:34writing the
  640. 25:35hardware description language code uh to
  641. 25:38describe our processor complex IC, and
  642. 25:41then like compiling it. We are just
  643. 25:44synthesizing it. It's like compilation.
  644. 25:46And in analog integrated circuit, people
  645. 25:48are doing
  646. 25:50uh handcrafted job. So, they are just
  647. 25:53sizing by hand.
  648. 25:55They are combining, putting the
  649. 25:56transistors, and combining them
  650. 25:59uh by hand.
  651. 26:01And also, uh there's another
  652. 26:03methodology, FPGA-based digital system
  653. 26:05design. This is different than the
  654. 26:07integrated circuit design, because
  655. 26:08integrated circuit is the chip itself,
  656. 26:11but FPGA is a little bit different. In
  657. 26:13FPGA, there is a chip inside here, and
  658. 26:16inside this chip, you are
  659. 26:18uh putting your HDL, hardware
  660. 26:21description language
  661. 26:23uh code.
  662. 26:25Uh I will not go into the details, but
  663. 26:27in here, in this methodology, it is not
  664. 26:29like this
  665. 26:30digital integrated circuit design,
  666. 26:32because in here, you are designing the
  667. 26:34integrated circuit itself.
  668. 26:36But in FPGA-based digital system design,
  669. 26:38there is a chip, and you are putting
  670. 26:40your HDL functionality into this chip,
  671. 26:42and somehow this chip functions as you
  672. 26:45described.
  673. 26:47You are still writing hardware
  674. 26:48description language in here.
  675. 26:51But its flow is different.
  676. 26:56So,
  677. 26:57computation and integrate circuit, I
  678. 26:59will mention about the overview and
  679. 27:01importance. Since, for example, you can
  680. 27:04think about
  681. 27:06you are running,
  682. 27:08for example, different software
  683. 27:10applications,
  684. 27:11like health, for example, health care
  685. 27:13systems, Chrome, or WhatsApp, for
  686. 27:15example, and these applications are
  687. 27:18running running over an operating
  688. 27:19system.
  689. 27:21And this operating system runs on a
  690. 27:23integrated circuit.
  691. 27:25There is a chip, and you are running
  692. 27:26this operating system in this chip.
  693. 27:29And this chip is produced somewhere
  694. 27:31else, for example, in outside, in
  695. 27:33Taiwan, or in United States.
  696. 27:36So, the important thing in here is that
  697. 27:39if you want to build
  698. 27:41if you want to use dependable, secure
  699. 27:44software, you need to be sure that
  700. 27:47all of the
  701. 27:49levels under the software
  702. 27:53must be developed by you, or must be
  703. 27:56developed by a secure people.
  704. 27:59So,
  705. 28:01that's the reason the the
  706. 28:04important point in here is that, for
  707. 28:06example, if you want to build a secure
  708. 28:08phone,
  709. 28:09or secure
  710. 28:11software,
  711. 28:13unless the hardware is not secure, you
  712. 28:15cannot provide 100% security. For this
  713. 28:18reason, it is very important to build
  714. 28:21their own IC. As as nation, it's for a
  715. 28:25nation, it is very important to build
  716. 28:26their own IC.
  717. 28:30Otherwise, for example, we can say that,
  718. 28:32"Okay, we have Pardus operating system,
  719. 28:34but it is not 100% secure." And I will
  720. 28:37mention about some examples
  721. 28:39about the security and importance of
  722. 28:42this building their own chips. By the
  723. 28:44way, Turkey is not building their own
  724. 28:45processor.
  725. 28:47That's why we are giving this class to
  726. 28:49to create an ecosystem and to do
  727. 28:52movements in this direction to build our
  728. 28:55own IC, own processor, like our own
  729. 28:58Intel processor. We can do it.
  730. 29:00Uh,
  731. 29:01unless hardware is made designed by us,
  732. 29:05uh, the software is not secure. This is
  733. 29:07the key point in here. What can be done?
  734. 29:09For example, you can purchase a chip
  735. 29:11from somewhere else and it can be
  736. 29:13counterfeit chips.
  737. 29:15It's a fake chip, like
  738. 29:16uh, people can put backdoors.
  739. 29:19It is very common, by the way. Uh, you
  740. 29:21can they can put backdoors inside this
  741. 29:23chip
  742. 29:24and they can get the control of this
  743. 29:26chip anytime. Uh, it's up to them.
  744. 29:29Uh, then they can intentionally life
  745. 29:32reduce the lifetime of this chip. For
  746. 29:34example, you are putting a chip inside a
  747. 29:36plane
  748. 29:38and you are thinking that this chip last
  749. 29:4010 years, but they intentionally reduced
  750. 29:43its lifetime to 4 years. So, after 4
  751. 29:45years, maybe the chip will malfunction.
  752. 29:49So, it's a catastrophic case.
  753. 29:51Uh, and I mentioned about also
  754. 29:53malfunction. They can change the
  755. 29:54functionality of the chip.
  756. 29:56So, that's very important. Why it is
  757. 29:58very important design and also produce
  758. 30:01our own chips as nation.
  759. 30:04Otherwise, only building to software is
  760. 30:06not enough. For example, we can build
  761. 30:08our own operating system, but it's not
  762. 30:10enough.
  763. 30:11Uh, we need to run them in our own
  764. 30:14integrated circuits and even we need to
  765. 30:17build these integrated circuits in here.
  766. 30:22Uh, let's see some examples what is
  767. 30:23happening if you cannot
  768. 30:25if you don't produce design your own
  769. 30:28chips. There is a
  770. 30:30some cases.
  771. 30:32Uh, one of them is in 2007. Uh, Syrian
  772. 30:36S-300s were disabled due to the
  773. 30:38backdoors within the networking chips.
  774. 30:40Actually, Israel disabled their
  775. 30:42uh,
  776. 30:44network chips, actually, uh
  777. 30:46by using their backdoors. So, they chip
  778. 30:49couldn't communicate. They couldn't
  779. 30:50sense Maybe they sensed the planes, but
  780. 30:53they couldn't inform the center.
  781. 30:56Because they hacked the They hacked the
  782. 30:59communication chips.
  783. 31:01Uh as far as I remember, it was It was
  784. 31:03Mellanox IC
  785. 31:05network chips. And they they used the
  786. 31:07backdoors of inside this chip.
  787. 31:10And you know, pager attack in Lebanon in
  788. 31:122020, for they they hacked the chips.
  789. 31:16And at any time, they they convert this
  790. 31:19phone to a bomb.
  791. 31:22You can Google it. If you don't know the
  792. 31:23in detail, you can Google it in in
  793. 31:26Google it and see the details.
  794. 31:28And also, restriction is also an
  795. 31:31another important thing in here. For
  796. 31:33example, you cannot buy If you want to,
  797. 31:36for example, buy a very high-speed
  798. 31:38analog-digital converter, you cannot buy
  799. 31:40it because they need to allow to sell it
  800. 31:43to you.
  801. 31:44And most likely, they are not allowing.
  802. 31:45For example,
  803. 31:46I know in processor, for example, if you
  804. 31:50if you want to purchase a processor, for
  805. 31:51example, 4 GHz, 5 5 GHz, very
  806. 31:54high-performance processor,
  807. 31:56uh you need to
  808. 31:58fill lots of documents, and you are
  809. 32:00getting permission. Otherwise, they are
  810. 32:02not selling you. And you know, in for
  811. 32:04example, GPUs, they were not selling to
  812. 32:07GPUs to
  813. 32:08China. They were selling
  814. 32:10not high-end GPUs to China, maybe around
  815. 32:132 3 years ago. So,
  816. 32:16they can easily restrict it. For this
  817. 32:18reason, we need to design our
  818. 32:19high-performance chips.
  819. 32:21And there are in here, you can read some
  820. 32:23news. I put some news. It is very
  821. 32:25important. For example, in Turkish
  822. 32:27drones, uh they found some parts, and
  823. 32:30they apply
  824. 32:32They stopped selling the some parts uh,
  825. 32:35to Turkey.
  826. 32:37So, and of course, as I told you, they
  827. 32:40they are registering the highest
  828. 32:41technology products.
  829. 32:44And also, I put uh, two news here. One
  830. 32:47of them says that uh, it was about the
  831. 32:49chip war around 2 years ago. Uh, it says
  832. 32:53that who controls the chip controls the
  833. 32:55world, uh, the silicon cold war. The the
  834. 32:57war actually between the China and
  835. 32:59United States mainly based on the chip.
  836. 33:02Uh, they are saying it as a silicon war.
  837. 33:06And most likely you will see this video.
  838. 33:08I I don't know. Yeah, you can read the
  839. 33:13uh, subtitle in here.
  840. 33:15For example,
  841. 33:16he is saying that if you are a holding a
  842. 33:18cell phone, it's a piece of Israel. He's
  843. 33:20saying that.
  844. 33:22Uh, because most of the chips inside
  845. 33:24this cell phone are built by them
  846. 33:26somehow.
  847. 33:34So, you can check them offline.
  848. 33:41So,
  849. 33:43that's all.
  850. 33:45Uh, in this class I told them that in
  851. 33:47this class we are going to see how to
  852. 33:49design very complex
  853. 33:51uh, chips.
  854. 33:53Uh,
  855. 33:54so how can we do it? How How How do we
  856. 33:56design things that are too big to fit in
  857. 33:58one person's head at once? Uh, there are
  858. 34:00three design methodologies in here.
  859. 34:03Uh, abstraction discipline uh, and there
  860. 34:05are three ways as I
  861. 34:07told. Uh, the important thing here in
  862. 34:10here is that hierarchy. So, we need to
  863. 34:12divide the for example, think even this
  864. 34:15core is very complex.
  865. 34:17Uh, we need to divide it into modules
  866. 34:19and sub modules and this each sub module
  867. 34:21for example, designed by a group of
  868. 34:24people.
  869. 34:26And modularity in here is important. Uh,
  870. 34:29having well-defined functions and
  871. 34:31interfaces between them.
  872. 34:33For example, this core is communicating
  873. 34:35with this core, and there should be a
  874. 34:37well-defined interfaces for them.
  875. 34:41And regularity. You look at If you
  876. 34:43design this core zero, and there are
  877. 34:45lots of cores in here, they are the
  878. 34:47same. You are just duplicating them.
  879. 34:51Replicating them, and it's the already
  880. 34:53half of the chip, for example. Half of
  881. 34:54the chip is the same of this core zero.
  882. 34:57And most likely these cores are very
  883. 34:58similar to this core. Only some
  884. 35:00configurations are different, and you
  885. 35:03are building most of the chips already.
  886. 35:05So, regularity is also important.
  887. 35:09So, we are following three ways in here:
  888. 35:11hierarchy, dividing everything into
  889. 35:13modules and submodules, modularity, uh
  890. 35:16there should be a well-defined functions
  891. 35:18between these modules, and regularity.
  892. 35:22So, it's like
  893. 35:23abstraction and discipline. Abstraction
  894. 35:25means that like it's related to
  895. 35:28hierarchy, also.
  896. 35:31So,
  897. 35:33in here we started Okay.
  898. 35:36We can continue a little bit more, and
  899. 35:38we can give a break.
  900. 35:41We didn't start the class yet. I will do
  901. 35:44some review on digital systems,
  902. 35:47uh and we will start with binary
  903. 35:48numbers.
  904. 35:49Uh most likely you are familiar with
  905. 35:51these concepts, and
  906. 35:54but let's do a some review on on it.
  907. 36:00Let me check this one.
  908. 36:03Okay.
  909. 36:25So, the first topic the in the in the
  910. 36:27radio is about the binary values.
  911. 36:30Uh there are two discrete values
  912. 36:33uh
  913. 36:33for in digital domain, one and zero.
  914. 36:36Everything consists of one and zero.
  915. 36:38Uh one is like voltage is on and zero is
  916. 36:42like voltage is off.
  917. 36:44Uh they are named as true or false or
  918. 36:47high and low or zero and one. There are
  919. 36:49different names for it for them.
  920. 37:00Let me check, please.
  921. 37:08So, this is a circuit used the voltage
  922. 37:10levels. Uh zero is generally low
  923. 37:12voltage. Uh zero is low voltage and
  924. 37:14correspond to ground and one is high
  925. 37:17voltage correspond with the VDD.
  926. 37:19And these levels corresponds to a bit,
  927. 37:22binary digit.
  928. 37:24And by using these bits, actually
  929. 37:26computers are as I told you consist of
  930. 37:28one and zeros. Uh they are not competing
  931. 37:31in decimal domain. Decimal is base 10.
  932. 37:34The numbers between zero and nine uh
  933. 37:36corresponds to base 10, but computers
  934. 37:39only know zero and one, binary system.
  935. 37:42And
  936. 37:44corresponding to the human uh humans use
  937. 37:47the decimal numbers. Uh actually these
  938. 37:49decimal numbers are represented in
  939. 37:51computer in one and zeros.
  940. 37:53And in here you there is a
  941. 37:55correspondence. Actually, you'll see
  942. 37:57there is a
  943. 37:58uh decimal number
  944. 38:00uh
  945. 38:01correspond this number and decimal
  946. 38:04equivalent of it. And binary number is
  947. 38:07like this one. It is also in decimal
  948. 38:09everything is 10 to the X, for example,
  949. 38:12the
  950. 38:13uh value of a digit in here is a 10 to
  951. 38:16X. The X is the digit's position.
  952. 38:20In a similar manner, in binary number,
  953. 38:22it is
  954. 38:23two to the X, where X is the
  955. 38:27digit number.
  956. 38:29So, for example, 1101,
  957. 38:32which is correspond which corresponds to
  958. 38:341 * 2 to the 3, because this this one is
  959. 38:37three, third one, plus 1 * 2 to 2, plus
  960. 38:410 * 2 to 1, and 1 plus 1 * 2 to 0, and
  961. 38:45it corresponds to 13.
  962. 38:47Actually, this binary number, for
  963. 38:48example, you put it in a computer, this
  964. 38:51corresponds to 13 in decimal system.
  965. 38:54And, as I told you, computer only
  966. 38:57understands the binary numbers. People
  967. 38:58are trying to build ternary or
  968. 39:00quaternary computers, but now the only
  969. 39:03there are commercially binary numbers
  970. 39:06are used by the computers.
  971. 39:10If don't know, you can interrupt me, but
  972. 39:13this course I will do a very quick
  973. 39:15review. And this no this course actually
  974. 39:19assumes a good knowledge on this digital
  975. 39:21systems.
  976. 39:24And in here, I put some examples to
  977. 39:26binary to decimal conversion and decimal
  978. 39:28to binary conversion. How can you do it?
  979. 39:31You can check the slides, and if you
  980. 39:33have a question, also you can ask.
  981. 39:35But,
  982. 39:37if you have a n-bit binary number, it
  983. 39:39can represent two to the n numbers,
  984. 39:41different values, and it represent
  985. 39:43between zero to two to the n minus one,
  986. 39:46the range between them.
  987. 39:48For example, three-digit binary number,
  988. 39:51it can
  989. 39:53it is between 000 and 111. So, there are
  990. 39:56eight possible values between these two
  991. 39:59numbers.
  992. 40:03Hexadecimal numbers is also very
  993. 40:05important. We are using while writing
  994. 40:07while building the processor, we are
  995. 40:09using hexadecimal a lot.
  996. 40:11Hexadecimal corresponds to base 16.
  997. 40:13Until now, we saw base 10, base two,
  998. 40:16base 16 is the another
  999. 40:18and it's named as hexadecimal numbers.
  1000. 40:21It's a short hand for binary. How it is
  1001. 40:23a short hand? Because four digit binary
  1002. 40:26number corresponds a digit in
  1003. 40:27hexadecimal number.
  1004. 40:29For example, this is a hexadecimal
  1005. 40:31number. By the way, hexadecimal number
  1006. 40:32is between zero and 15.
  1007. 40:34Uh decimal is between zero and nine,
  1008. 40:37binary is between zero and one,
  1009. 40:39uh and hexadecimal is between zero and
  1010. 40:4215. And after 10, people are represented
  1011. 40:45as a A B C D E F.
  1012. 40:48And each four bits in binary corresponds
  1013. 40:51to a digit in hexadecimal.
  1014. 40:54So, in order to convert a hexadecimal to
  1015. 40:56decimal, it is the same. Uh
  1016. 40:59in here, our base is 16. So, 16 * 16 uh
  1017. 41:04power of
  1018. 41:06uh the digit position times the value.
  1019. 41:08For example, it is 4 * 16 squared plus
  1020. 41:13uh 10 * A corresponds to 10. 10 * 16
  1021. 41:16plus uh 15.
  1022. 41:18F E F corresponds to 15 and this is the
  1023. 41:20decimal conversion.
  1024. 41:22So, for example, as I told you, a
  1025. 41:25hexadecimal number corresponds to four
  1026. 41:27four-bit binary number. And for four,
  1027. 41:30for example, it corresponds to 0 1 0 0
  1028. 41:33because this is four actually in
  1029. 41:35hexadecimal.
  1030. 41:37For example, A is 10 and when you look
  1031. 41:39at this four digit, it is a it
  1032. 41:41corresponds to 10. 2 + 8, it is 10.
  1033. 41:46Let me activate this one.
  1034. 42:04And in digital systems, we have some
  1035. 42:07terms. Bits, we we know zero and one.
  1036. 42:11Uh bytes and nibbles. Uh, byte
  1037. 42:14corresponds to eight bits. Most likely
  1038. 42:15you know about the RAM. Uh, for example,
  1039. 42:18your RAM is can be described in terms of
  1040. 42:21bytes. Uh, so bytes correspond to eight
  1041. 42:24bits. Nibble is the half byte. It is
  1042. 42:27four bits. And half is 16 bits. A word
  1043. 42:30is 32 bits. Double is 64 bits.
  1044. 42:35Uh, people also using kilo, mega, giga,
  1045. 42:37tera, peta, exa.
  1046. 42:39Uh, these are 2 to the 10, 2 to the 20.
  1047. 42:42And this is the approximate value in
  1048. 42:45decimal.
  1049. 42:47For example, if you say that 1 kilobyte,
  1050. 42:49uh, it is actually 2 to the 10 to 2 to
  1051. 42:5210 byte.
  1052. 42:55In a number,
  1053. 42:57uh, the leftmost one is the most
  1054. 42:59significant bit and rightmost is the
  1055. 43:02least significant bit.
  1056. 43:03Uh, this says eight-bit number, it is a
  1057. 43:05byte. And half of it is a nibble. Uh, we
  1058. 43:08are not using nibble much.
  1059. 43:10Uh, and this is a hexadecimal number,
  1060. 43:12for example. This is the least
  1061. 43:14significant byte in this hexadecimal
  1062. 43:16number. This is eight-bit and this is a
  1063. 43:18byte. And this CE is the most
  1064. 43:21significant byte. In here, for example,
  1065. 43:23there is 64-bit number.
  1066. 43:26This is a 64-bit number. And when you
  1067. 43:29separate it as bytes, each two of them
  1068. 43:32is a byte.
  1069. 43:33Uh, sorry, this is a 32-bit byte. 30-bit
  1070. 43:36number because there are four bytes in
  1071. 43:38here.
  1072. 43:42While doing arithmetic operations in
  1073. 43:44digital systems, we use the two's
  1074. 43:46complement.
  1075. 43:47Uh, so in two's complement number, we
  1076. 43:50have a number like this one, XYZ, for
  1077. 43:53example. And the most significant bit,
  1078. 43:56the leftmost one, is the uh, sign bit,
  1079. 44:00like sign bit.
  1080. 44:01So it has a weight of minus 2 to the M
  1081. 44:04minus 1. So if this is one, for example,
  1082. 44:07uh,
  1083. 44:09its weight is -2 and -1. It is if it is
  1084. 44:13zero, its weight is when you go
  1085. 44:16multiply it with zero, it is zero.
  1086. 44:19So, whenever is a number is minus, this
  1087. 44:22bit is one.
  1088. 44:23So, in this representation in two's
  1089. 44:25complement representation, if you have a
  1090. 44:28number, you can use this formula to find
  1091. 44:30its decimal correspondence as signed.
  1092. 44:33And in this representation, most
  1093. 44:35positive four-bit number is 01111, okay?
  1094. 44:38Because
  1095. 44:39this is zero.
  1096. 44:41When you look at here, it brings zero,
  1097. 44:43and this one is
  1098. 44:454 2 1. When you sum them, it is seven.
  1099. 44:49And most negative four-bit number is one
  1100. 44:52and three zero. So, because why it is
  1101. 44:54so, when you look at here, -2 and -1,
  1102. 44:59-2 power -1.
  1103. 45:01So, it is -2
  1104. 45:04power three, it is -8.
  1105. 45:10By the way, this formula is like this
  1106. 45:12one, okay?
  1107. 45:13So,
  1108. 45:15what about this 1111?
  1109. 45:18It is like -8 plus
  1110. 45:214 + 2 + 1, so it is -1. It is not the
  1111. 45:25most negative one.
  1112. 45:27The most negative one is this this one
  1113. 45:29for this reason in two's complement.
  1114. 45:33So, the range of an n-bit two's
  1115. 45:35complement number is between this.
  1116. 45:37And in order to reverse the sign of a
  1117. 45:39two's complement number, you need to
  1118. 45:41invert the bits and add one. So, you
  1119. 45:44need to make this zero to one, this zero
  1120. 45:47to one, this zero to one, and this one
  1121. 45:49to zero, and after that, add one in
  1122. 45:51order to reverse its sign.
  1123. 45:55So, invert the bits and add one. This is
  1124. 45:57the method one. In method two,
  1125. 46:00for example, this is a number, 0101
  1126. 46:040.
  1127. 46:05You want to invert the sign of this
  1128. 46:07number. You start look start to look at
  1129. 46:09from this direction. Whenever you saw
  1130. 46:11first one, just
  1131. 46:13invert the bits after [snorts] after
  1132. 46:15this bit.
  1133. 46:17Okay?
  1134. 46:20So, in here I put four-bit
  1135. 46:22representation of a two's complement
  1136. 46:25numbers.
  1137. 46:31So, in here we can give a break.
  1138. 46:35Uh I was planning to give break at 30.
  1139. 46:38So, we can give a break. Maybe we can
  1140. 46:40start at
  1141. 46:421:50.
  1142. 46:44Okay?
  1143. 46:46After 18 minutes.
  1144. 47:01And then
  1145. 47:02That's the way
  1146. 47:03uh we we will Okay. Reviewing the
  1147. 47:06digital systems.
  1148. 47:07And
  1149. 47:09we will see the number systems. So, you
  1150. 47:11need to know them. I am not trying to
  1151. 47:13teach you. I am just trying to remind
  1152. 47:15you.
  1153. 47:16So, but you need to know these
  1154. 47:18uh concepts.
  1155. 47:20Digital systems, binary numbers,
  1156. 47:21conversion, binary number conversion,
  1157. 47:23hexadecimal numbers, and these concepts,
  1158. 47:25and two's complement. This is very
  1159. 47:27important.
  1160. 47:28Uh you need to know them.
  1161. 47:30And also, you need to know the
  1162. 47:32fundamentals of transistors.
  1163. 47:34So, transistors
  1164. 47:36uh in here there are two types of
  1165. 47:37transistors, N-MOS and P-MOS.
  1166. 47:40Uh and N-MOS and P-MOS is the different
  1167. 47:43working behaviors. In N-MOS, if the you
  1168. 47:46apply a zero
  1169. 47:48to gate,
  1170. 47:49uh it's not conducting.
  1171. 47:52Uh so, if here here is zero, it's not
  1172. 47:55conducting.
  1173. 47:57So, it means that no connection between
  1174. 47:59the source and drain. Source and drain
  1175. 48:00is the like for example, it is input and
  1176. 48:04it goes through the it comes from drain
  1177. 48:06and goes through the source. And if we
  1178. 48:09apply zero to gate, it's not conducting.
  1179. 48:11If we apply one to gate, it's
  1180. 48:13conducting. There is a channel in here
  1181. 48:15and it connects drain to source. So, the
  1182. 48:18information can flow from here to here.
  1183. 48:21And PMOS is the opposite. If it is uh
  1184. 48:25gate is zero, it is on. So, if you apply
  1185. 48:27zero volt to here, it is on. It's
  1186. 48:30conducting. If you apply one to here, it
  1187. 48:33is not conducting.
  1188. 48:35And by using this NMOS and PMOS
  1189. 48:38transistors, at the beginning I
  1190. 48:39mentioned about the transistors, but
  1191. 48:42transistors is two types, NMOS and PMOS.
  1192. 48:44And by using both these two transistor
  1193. 48:47types, we are building the logic gates.
  1194. 48:50How we are building? Uh there are two
  1195. 48:53networks. One of them is pull-up network
  1196. 48:55consists of PMOS transistors and other
  1197. 48:57one is a pull-down network consisted of
  1198. 48:59NMOS transistors. Pull-up network
  1199. 49:01devices are connected to the VDD power
  1200. 49:05source and NMOS
  1201. 49:07uh
  1202. 49:08ones are connected to pull-down network.
  1203. 49:11And we are applying to input to here and
  1204. 49:14then getting the output from here.
  1205. 49:17So, the important thing in here is that
  1206. 49:20for NMOS, uh it pass the zero. It means
  1207. 49:24that V VSS or ground
  1208. 49:27uh in a good way.
  1209. 49:29This NMOS transistor passes the VSS well
  1210. 49:32and this PMOS transistor passes the VDD
  1211. 49:34well.
  1212. 49:37For example, in here we have a not gate.
  1213. 49:41And in this not gate
  1214. 49:43uh for example
  1215. 49:45uh this not gate consists of these
  1216. 49:48transistors, one PMOS transistor in
  1217. 49:50here, one NMOS transistor in here. And
  1218. 49:53NOT gate is actually basically does if
  1219. 49:55you apply a zero,
  1220. 49:57it converts it to one and if you apply
  1221. 49:59one, it converts it to zero. So,
  1222. 50:01whenever you apply a zero to this A, Y
  1223. 50:04gives one. It inverts it.
  1224. 50:06So, when you look at this
  1225. 50:09uh the logic gate correspondence of it,
  1226. 50:12transistor correspondence of it, there
  1227. 50:14is a PMOS gate in here and NMOS gate in
  1228. 50:16here. NMOS is connected to GND, ground,
  1229. 50:18and PMOS is connected to VDD.
  1230. 50:20Whenever you apply a zero to A, it means
  1231. 50:23that
  1232. 50:24Y is the output in here. Whenever you
  1233. 50:26apply A to here,
  1234. 50:28it means that NMOS gate is disconnected,
  1235. 50:31transistor is disconnected, so there is
  1236. 50:33no connection
  1237. 50:35to this Y point to the ground.
  1238. 50:37But, this PMOS transistor contacts.
  1239. 50:40So, it passes this VDD voltage to Y. So,
  1240. 50:44it gives one.
  1241. 50:46What about one? If you apply one to
  1242. 50:48here, in this case, this PMOS closed,
  1243. 50:51NMOS passing. So, this ground is
  1244. 50:53connected to Y, it gives zero.
  1245. 50:56This is the This is the case for the
  1246. 50:58base inverter, but it's same for the
  1247. 51:00AND, OR, XOR, any other gates.
  1248. 51:04For example, this is a correspondence
  1249. 51:06for NOT NAND gate. It is NOT AND gate.
  1250. 51:09So, you can also build this by using the
  1251. 51:12same pull-up and pull-down network
  1252. 51:14structure, you can build also NAND gate.
  1253. 51:18But, this time it has
  1254. 51:20two inputs and one output.
  1255. 51:22We are using four transistors. These
  1256. 51:24PMOS transistors are connected as serial
  1257. 51:26and NMOS transistors connected as
  1258. 51:28parallel
  1259. 51:29in here and it corresponds to NAND gate.
  1260. 51:33So, when you look at the DC
  1261. 51:34characteristics of, for example, take an
  1262. 51:37example an ideal buffer. A buffer is
  1263. 51:39like actually two inverters connected to
  1264. 51:42each other. So, whenever you apply zero
  1265. 51:44to here, you you get one you are getting
  1266. 51:46one from here and then again getting
  1267. 51:48zero to here. So, when you look at it,
  1268. 51:50it is a big buffer.
  1269. 51:52Whenever you apply zero to here, you are
  1270. 51:53getting zero.
  1271. 51:55The good thing in here is that
  1272. 51:58it is actually For example, this zero is
  1273. 52:00a little bit weak.
  1274. 52:02For example, people are using buffer to
  1275. 52:04to
  1276. 52:05strengthen
  1277. 52:06signal.
  1278. 52:08For example, you are applying zero to
  1279. 52:09here, but it is like maybe 0.1 V.
  1280. 52:12Because think
  1281. 52:15in here, for example, there are two
  1282. 52:17voltage
  1283. 52:18Off means zero, on means VDD. For
  1284. 52:21example, you can say that 0.8 V. The V
  1285. 52:25on is 0.8 V. It is 1 V. Corresponds to
  1286. 52:28logic one, and this one corresponds to
  1287. 52:30logic zero.
  1288. 52:32Buffer is used it for for example,
  1289. 52:35sometimes due to the noise,
  1290. 52:38it is not exactly zero, but it is a
  1291. 52:40little bit higher than zero, 0.1, for
  1292. 52:42example. So, whenever you apply 0.1
  1293. 52:44point here,
  1294. 52:45and this is a active
  1295. 52:48component. It has a VDD and VSS
  1296. 52:51connection, and VSS is zero.
  1297. 52:55It eliminates the noise in here and
  1298. 52:56gives zero to here. Or maybe in other
  1299. 52:59way, for one, for example, you are
  1300. 53:01applying maybe 0.7 V. A little bit
  1301. 53:03noisy, not exactly 0.8 V.
  1302. 53:06But in here, when you pass it through
  1303. 53:09the buffer, you are getting exactly like
  1304. 53:110.8 V. It's You are making the signal
  1305. 53:14stronger.
  1306. 53:15That's why people are using buffer. And
  1307. 53:17when you look at the characteristic of
  1308. 53:19this buffer, normally ideally it is like
  1309. 53:22exact zero, and it passes one.
  1310. 53:26So, if it is zero, it gives zero. If it
  1311. 53:28is one, it gives exact one. But it is
  1312. 53:30not always so.
  1313. 53:32In the real case, it is like so.
  1314. 53:35In real case, also, we are As I told
  1315. 53:37you, we are not getting exact zero. We
  1316. 53:39are getting something between zero and a
  1317. 53:41low threshold voltage and also for the
  1318. 53:45output we are getting something very
  1319. 53:46close to high
  1320. 53:49logic one volt but not exactly.
  1321. 53:51So it is real characteristic actually in
  1322. 53:54in in such a way.
  1323. 53:58Normally I told that 0.8 volt Normally
  1324. 54:02as I told you zero and one is the
  1325. 54:04logical correspondence but actual
  1326. 54:06voltage correspondence are different.
  1327. 54:08For example, for zero it is generally
  1328. 54:10always zero but for one it's changing.
  1329. 54:13In the previous chips, for example, in
  1330. 54:1619 and 70s it was 5 volt. Now in for
  1331. 54:20example in our to into bit act we are
  1332. 54:23designing
  1333. 54:25circuits with
  1334. 54:270.8 volt. At 0.8 volt it corresponds to
  1335. 54:29logic one.
  1336. 54:31So it is decreasing by the
  1337. 54:35improvement in the technology this
  1338. 54:37voltage is decreasing. This The reason
  1339. 54:40why people are trying to decrease it due
  1340. 54:42to the power consumption. They are
  1341. 54:43trying to decrease the power consumption
  1342. 54:45of integrated circuits.
  1343. 54:46Now
  1344. 54:48in maybe very in very high-end
  1345. 54:51technology notes like 2 nanometer 3
  1346. 54:54nanometer technology notes people are
  1347. 54:55using around 0.7 and 0.6 volts. It's
  1348. 54:59very low at these notes.
  1349. 55:03So VDD is dropping
  1350. 55:05by time.
  1351. 55:10And
  1352. 55:11it depends on the logic family. For
  1353. 55:13example, for TTL logic family the it is
  1354. 55:16between zero and five. For CMOS it is
  1355. 55:20yeah a little bit different.
  1356. 55:21Uh
  1357. 55:23And LVTTL it is low voltage TTL the VDD
  1358. 55:26is 3.3 and for LVC most it is 3.3 but
  1359. 55:30there are small differences between the
  1360. 55:33ranges.
  1361. 55:34Uh Uh, because the issue in here is that
  1362. 55:37since this is a real buffer circuitry,
  1363. 55:41it is not ideal.
  1364. 55:43In in a computer in digital domain, it
  1365. 55:46is not exactly at zero or 0.8 8. It is a
  1366. 55:51little bit closer to zero.
  1367. 55:53So, for example, it is between zero and
  1368. 55:55zero one.
  1369. 55:57You can say it that this real buffer
  1370. 55:59pass
  1371. 56:00passes it as zero.
  1372. 56:03But, for example, what about 0.3?
  1373. 56:06If it is 0.3, it is not allowed.
  1374. 56:10So, there shouldn't be any
  1375. 56:13transistor working at this voltage,
  1376. 56:15giving
  1377. 56:16output at this voltage. So,
  1378. 56:19the computer chips generally says that
  1379. 56:22this range is corresponds to zero and
  1380. 56:25this range corresponds to one.
  1381. 56:27And between them, it is forbidden. You
  1382. 56:30are not driving any transistor between
  1383. 56:31these range. You need to actually design
  1384. 56:34your circuitry accordingly. But, as
  1385. 56:36digital designer, we are not dealing
  1386. 56:37with it because I mentioned that we are
  1387. 56:39doing abstraction. We are not designing
  1388. 56:40analog circuits. Normally, everything is
  1389. 56:42analog.
  1390. 56:43For example, we are building we are
  1391. 56:44using the transistors and building the
  1392. 56:46logic gates. Actually, logic gates are
  1393. 56:48itself inherently analog.
  1394. 56:50But, we are abstracting them and using
  1395. 56:52as digital. So, we are not dealing with
  1396. 56:54analog.
  1397. 56:55Uh, but this is the fundamental. You
  1398. 56:57need to know the fundamentals.
  1399. 57:00But, of course, we will not deal with
  1400. 57:01any voltages. For everything everything
  1401. 57:04for us is zero or 0.8 VDD and ground.
  1402. 57:10And there are some
  1403. 57:12concepts for logic gates also. We
  1404. 57:14mention about one and zero in here. Uh,
  1405. 57:17voltage on and voltage off.
  1406. 57:19And there are two values also in logic
  1407. 57:22gates. One of them is unknown and one of
  1408. 57:25them is floating.
  1409. 57:28Uh, for floating, it is very easy. It is
  1410. 57:30a easy. It is high It means high
  1411. 57:33impedance, open. So, for example, if you
  1412. 57:35have a wire
  1413. 57:37if for example, you have a wire and you
  1414. 57:39didn't connect anything to this wire, so
  1415. 57:41you don't know whether it is zero or 0.8
  1416. 57:44or anything between them. You don't know
  1417. 57:46anything about this voltage.
  1418. 57:48So, it is floating, actually. It is high
  1419. 57:50impedance. It is open.
  1420. 57:55So, what about contention?
  1421. 57:57Uh
  1422. 57:58contention
  1423. 58:00uh is the case where the circuit tries
  1424. 58:02to drive output to one and zero at the
  1425. 58:04same time.
  1426. 58:06It is still not known.
  1427. 58:08For example, in here I have an inverter
  1428. 58:11and I have another inverter in here. For
  1429. 58:15uh in here, I'm driving one, so it tries
  1430. 58:17to drive zero to this Y. And for in from
  1431. 58:21here, it tries to drive one
  1432. 58:24to here.
  1433. 58:25And still
  1434. 58:26it we don't know
  1435. 58:28the output on here. But, this one is a
  1436. 58:30different case. It is named as
  1437. 58:32contention. Circuit tries to drive
  1438. 58:34output to one and zero at the same time.
  1439. 58:37Floating is a little bit different. In
  1440. 58:39floating, we are not driving. It is
  1441. 58:41open.
  1442. 58:42And both of them are unknown. We don't
  1443. 58:44know.
  1444. 58:46Uh for contention, actual value is
  1445. 58:48somewhere somewhere in between. Uh it
  1446. 58:50could be zero or one, but forbidden.
  1447. 58:53Uh
  1448. 58:54its actual value can change depending on
  1449. 58:56the voltage, temperature, time, and
  1450. 58:58noise.
  1451. 58:59Uh so, this is very problematic because
  1452. 59:02it it causes excessive power
  1453. 59:03dissipation.
  1454. 59:05Because you are providing current to
  1455. 59:07here and this one is consuming this
  1456. 59:08current. So, this is
  1457. 59:10causes excessive power dissipation.
  1458. 59:13And this X is also used for
  1459. 59:15uninitialized values and don't cares.
  1460. 59:18And floating is also same as I told you,
  1461. 59:20but in here we are not driving anything,
  1462. 59:22so it is safer. This floating case is
  1463. 59:25safer.
  1464. 59:26Uh
  1465. 59:27in here, the message that I'm trying to
  1466. 59:29give you is that not everything is one
  1467. 59:31or zero. You can You need to know the
  1468. 59:33knowledge of X and Z also. Z is means
  1469. 59:36that not driving and X means that
  1470. 59:38unknown. We don't know the value in
  1471. 59:40here.
  1472. 59:43For example, most likely you know
  1473. 59:45three-state buffer. Three-state buffer
  1474. 59:47has an input enable. And whenever this
  1475. 59:50enable is one, this A passes to Y.
  1476. 59:54But whenever this E is zero, this Y is
  1477. 59:56floats. It is not connected. This A is
  1478. 59:59not connected to Y. So, Y floats.
  1479. 1:00:03Nothing drives Y. So, in this case, if A
  1480. 1:00:06is zero, we are showing the Y as Z. And
  1481. 1:00:09whenever E is one, A is passes through
  1482. 1:00:12Y.
  1483. 1:00:14This is three-state buffer. It's very
  1484. 1:00:15useful actually. Three-state buffer is
  1485. 1:00:17very useful if you are building a bus,
  1486. 1:00:18for example.
  1487. 1:00:20Uh, for example, you have a signal in
  1488. 1:00:22here and this signal is right by
  1489. 1:00:25different sources.
  1490. 1:00:27But not at the same time.
  1491. 1:00:29So, for example, A is driving this bus,
  1492. 1:00:32B is driving this bus, C is driving this
  1493. 1:00:34bus, but not at the same time. So,
  1494. 1:00:36three-state is useful. So, if you put a
  1495. 1:00:39three-state buffer in here
  1496. 1:00:41and only at any time one of them has E
  1497. 1:00:44is one and other one is E is zero. And
  1498. 1:00:47in this way, for example, if
  1499. 1:00:50A's three-state buffer is one, this A
  1500. 1:00:52drives this bus. So, it is very useful
  1501. 1:00:54circuit.
  1502. 1:00:57So, in here we have a diagram that shows
  1503. 1:00:59it. For example, in here we have a
  1504. 1:01:01shared bus and this bus is driving by
  1505. 1:01:03processor, video, ethernet and memory.
  1506. 1:01:06And at any time one of them
  1507. 1:01:09sets the enables to one and other one
  1508. 1:01:12sets it as zero. And this one drives
  1509. 1:01:14this bus.
  1510. 1:01:17But as a practical information,
  1511. 1:01:20generally
  1512. 1:01:21or almost always we are not using
  1513. 1:01:23tri-state buffers in our
  1514. 1:01:24high-performance integrated circuit
  1515. 1:01:26processor designs. We are not using it
  1516. 1:01:28because tri-state buffers lack in
  1517. 1:01:30timing.
  1518. 1:01:31So, its timing is not good. For example,
  1519. 1:01:33if you want high frequency like 1 GHz, 2
  1520. 1:01:35GHz, 3 GHz, tri-state buffer doesn't
  1521. 1:01:38provide enough frequency to you. So, we
  1522. 1:01:39are not using tri-state buffers.
  1523. 1:01:42But, it is useful if you are using a
  1524. 1:01:44maybe low frequency uh processor trying
  1525. 1:01:47to build a low frequency processor,
  1526. 1:01:49tri-state buffer can be useful.
  1527. 1:01:52Logic gates, there are two types of
  1528. 1:01:54logic gates. One of them is for
  1529. 1:01:55combinational logic gates, other one is
  1530. 1:01:57sequential. Combinational logic gates
  1531. 1:01:59are memoryless. There is no memory. It
  1532. 1:02:01has no state actually. We are not
  1533. 1:02:03keeping any state. We are just applying
  1534. 1:02:05input and getting output. There is a
  1535. 1:02:07functionality inside in here.
  1536. 1:02:10Like AND gate, for example. AND gate, it
  1537. 1:02:12has a no state. It has two inputs, one
  1538. 1:02:15output. Whenever we change the input,
  1539. 1:02:17it's changing the output, but there is
  1540. 1:02:19no state inside here. For example, it's
  1541. 1:02:20not keeping the previous value of the
  1542. 1:02:22output.
  1543. 1:02:24It has nothing to do
  1544. 1:02:26with the previous output. So, the
  1545. 1:02:28combinational logic is memoryless. So,
  1546. 1:02:30output determined by current values of
  1547. 1:02:33the inputs only.
  1548. 1:02:34And there is also another concept, it is
  1549. 1:02:36sequential logic. Sequential logic has
  1550. 1:02:38memory. It has a memory inside and it
  1551. 1:02:41keeps a state. And outputs depend on the
  1552. 1:02:44input and state at the same time in
  1553. 1:02:46sequential logic.
  1554. 1:02:48So, outputs determined by previous and
  1555. 1:02:50current values of inputs.
  1556. 1:02:54You should be familiar, by the way,
  1557. 1:02:56with these concepts because it is a
  1558. 1:02:59content I think related to a content in
  1559. 1:03:01second class, the course you took in
  1560. 1:03:03second class, second Yeah, second year.
  1561. 1:03:07Uh
  1562. 1:03:07In here, you can see a summary of the
  1563. 1:03:09combinational logic gates. Uh there are
  1564. 1:03:11inversion, NOT, AND, OR, NAND, NOR
  1565. 1:03:15uh gates.
  1566. 1:03:17Single input ones are not gate and
  1567. 1:03:20buffer and two input ones are and or
  1568. 1:03:22exor nand nor exnor. And there are
  1569. 1:03:24multiple input ones also.
  1570. 1:03:27Uh, so for example, you can build five
  1571. 1:03:28input and gates also. It is
  1572. 1:03:31you can do it.
  1573. 1:03:32Uh, and also
  1574. 1:03:35the three-state buffer is also two input
  1575. 1:03:37gate because it has a
  1576. 1:03:38two two inputs, enable and input.
  1577. 1:03:42And you can also, for example, build a
  1578. 1:03:45two to one mux by using these logic
  1579. 1:03:48gates.
  1580. 1:03:49Uh, you can see all their look up tables
  1581. 1:03:51in here.
  1582. 1:03:56Yeah, you you need to be familiar with
  1583. 1:03:57these concepts, but of course you might
  1584. 1:04:00be forgetting them since maybe
  1585. 1:04:02it was
  1586. 1:04:04one one years before,
  1587. 1:04:06uh, but you can review.
  1588. 1:04:09So,
  1589. 1:04:11more complex systems built on top of the
  1590. 1:04:13fundamental gates. For example, in here
  1591. 1:04:15I uh, here I have an example priority
  1592. 1:04:17circuit. This priority circuit is
  1593. 1:04:19actually just look at this input
  1594. 1:04:23and it gives one
  1595. 1:04:27in the corresponding output,
  1596. 1:04:29depending on the input. For example, in
  1597. 1:04:31here
  1598. 1:04:32in the input, if A3 is one, it says that
  1599. 1:04:37this A3 is one, so it makes Y3 one and
  1600. 1:04:40other zero.
  1601. 1:04:42And it doesn't matter what the other A2
  1602. 1:04:45A1 A0 is one or zero.
  1603. 1:04:49So, whenever A3 is one, it gives Y3 as
  1604. 1:04:52one, but if A3 is not one,
  1605. 1:04:56it selects the one
  1606. 1:04:59uh, with highest actually most
  1607. 1:05:01significant one.
  1608. 1:05:03So, this Y output actually shows the
  1609. 1:05:06corresponds to the digit that is the
  1610. 1:05:09most significant and it is one.
  1611. 1:05:11Okay, this is the priority circuit. You
  1612. 1:05:13can understand it by looking this uh
  1613. 1:05:16look up table.
  1614. 1:05:17Uh in this look up table, this one is
  1615. 1:05:19the inputs and this one is the outputs.
  1616. 1:05:23So, whenever, for example, A3, A2, and
  1617. 1:05:26A1 is zero,
  1618. 1:05:29in this case, Y0 is one if A0 is one. If
  1619. 1:05:33it is zero, is A0 is zero.
  1620. 1:05:37But, for example, whenever A2 is one,
  1621. 1:05:41and A3 is zero,
  1622. 1:05:44these values doesn't matter. It gives it
  1623. 1:05:47signals Y2 as one.
  1624. 1:05:49Because the most significant one in the
  1625. 1:05:52circuit is A2, so A2 corresponds to Y2.
  1626. 1:05:56So, there's a direct correlation between
  1627. 1:05:58them.
  1628. 1:05:59So, if the most significant bit is A3,
  1629. 1:06:02one, then Y3 becomes one. If it is A2,
  1630. 1:06:06Y2 becomes one. If it is A1, Y1 becomes
  1631. 1:06:08one.
  1632. 1:06:10So, how can we design such a circuit? Uh
  1633. 1:06:13we are using AND OR gates by design such
  1634. 1:06:16a circuit. There are methods, I will not
  1635. 1:06:19show these methods,
  1636. 1:06:20uh but, for example, when you look at
  1637. 1:06:22this
  1638. 1:06:23look up table,
  1639. 1:06:25uh truth table,
  1640. 1:06:26uh Y3 actually is corresponding directly
  1641. 1:06:29to A3. Whenever A3 is one, Y3 is also
  1642. 1:06:32one. So, we can say that Y3 is equal to
  1643. 1:06:35A3.
  1644. 1:06:36So, Y3 is directly connected to A3.
  1645. 1:06:39What about Y2?
  1646. 1:06:41Y2 is one only if A2 is one and A3 is
  1647. 1:06:44not one. Because if A3 is one, then it
  1648. 1:06:48means that Y3 is one, because the most
  1649. 1:06:50significant one is A3.
  1650. 1:06:52So, it's corresponding
  1651. 1:06:54logic equivalence is A3 not times A2.
  1652. 1:06:59And this is for Y1 and this is for Y0.
  1653. 1:07:01So, this is compared to basic logic
  1654. 1:07:05gates, this is more complex circuitry
  1655. 1:07:07because it is priority circuit.
  1656. 1:07:09And we are building it by using this
  1657. 1:07:12NAND gates.
  1658. 1:07:14We can build it.
  1659. 1:07:15These are the primitive gates and
  1660. 1:07:17combining with these primitive gates, we
  1661. 1:07:19are building more complex circuitry and
  1662. 1:07:22by bring by using this
  1663. 1:07:24a little bit complex circuitry and we
  1664. 1:07:26are building much more complex circuitry
  1665. 1:07:28and at then we are designing very
  1666. 1:07:31complex high performance processors. For
  1667. 1:07:33example, priority circuits are
  1668. 1:07:35very widely used in an out of order
  1669. 1:07:38processor.
  1670. 1:07:41But of course, we as I told you, we are
  1671. 1:07:42not
  1672. 1:07:44designing by combining the transistors.
  1673. 1:07:46We will design it by writing hardware
  1674. 1:07:48description language and in this class
  1675. 1:07:50also I will mention about I will teach
  1676. 1:07:52you hardware description languages,
  1677. 1:07:54which is a System Verilog.
  1678. 1:07:57So, what about sequential logic gates?
  1679. 1:07:59In sequential logic gates, outputs of
  1680. 1:08:01the sequential logic depend on the
  1681. 1:08:02current and prior input values if it has
  1682. 1:08:05a memory.
  1683. 1:08:07Uh
  1684. 1:08:08so, it has a memory by the way. Uh
  1685. 1:08:11there are some definitions in here.
  1686. 1:08:13State is the information
  1687. 1:08:15uh kept inside a circuit inside the
  1688. 1:08:17circuit in sequential logic circuit.
  1689. 1:08:21And we can keep the state in latches and
  1690. 1:08:23flip-flops. They are named as state
  1691. 1:08:25elements.
  1692. 1:08:26Uh they store one bit of state.
  1693. 1:08:29And synchronous sequential circuits are
  1694. 1:08:31the sequential circuits using flip-flops
  1695. 1:08:33sharing a common clock.
  1696. 1:08:36So, the most basic actually in here,
  1697. 1:08:39okay, I mentioned about state. Uh
  1698. 1:08:42state is like a
  1699. 1:08:44state of the circuit. It's like memory.
  1700. 1:08:46Okay, the the
  1701. 1:08:48in sequential logic gates, circuit has a
  1702. 1:08:50memory.
  1703. 1:08:52And it keeps a state in this memory.
  1704. 1:08:55And in order to keep it as for memory,
  1705. 1:08:58we are using latches and flip-flops.
  1706. 1:09:01And in here, we have a basic memory.
  1707. 1:09:07We know gates, okay? In In gates, we are
  1708. 1:09:09applying some input and getting an
  1709. 1:09:11output. But, how we should keep a logic
  1710. 1:09:14value?
  1711. 1:09:17How can we design a memory element that
  1712. 1:09:19keeps the value?
  1713. 1:09:22In the most basic methodology, we can
  1714. 1:09:25design it by using cross-coupled
  1715. 1:09:27inverters.
  1716. 1:09:28So, in here, I have an inverter and
  1717. 1:09:31another inverter. They are connected to
  1718. 1:09:32each other.
  1719. 1:09:34So, this is same connection topology, by
  1720. 1:09:36the way.
  1721. 1:09:38So, in here, when we cross-couple an
  1722. 1:09:41inverter, it keeps the value. For
  1723. 1:09:43example, think that
  1724. 1:09:45this is two inverters.
  1725. 1:09:47Think that, for example, I have a one in
  1726. 1:09:50here
  1727. 1:09:52and zero in this Q in this Q output. And
  1728. 1:09:56the zero in this Q output feeds zero to
  1729. 1:10:00second inverter. And this second
  1730. 1:10:02inverter gives one in Q bar in Q not.
  1731. 1:10:06And this one
  1732. 1:10:08is already one in here.
  1733. 1:10:09So, if I don't interfere the circuit,
  1734. 1:10:13it keeps this value. For example, if
  1735. 1:10:16there is a Q is zero, for example, it
  1736. 1:10:18keeps zero to here. Because, by the way,
  1737. 1:10:20these are VDD and VSS connections. They
  1738. 1:10:23are not shown generally.
  1739. 1:10:26But, this keeps this value.
  1740. 1:10:28Just four transistors. By using just
  1741. 1:10:30four transistors, we can keep single
  1742. 1:10:32value.
  1743. 1:10:33So, whenever If I want to change this
  1744. 1:10:35value, I can apply zero to here, and
  1745. 1:10:37this zero flips everything.
  1746. 1:10:40Flips this one, and this flips this one,
  1747. 1:10:42and in here, starting from after
  1748. 1:10:44applying this zero, this Q gives one.
  1749. 1:10:47But, if I don't touch this circuit, it
  1750. 1:10:49keeps this value, right? This coupled
  1751. 1:10:51inverters keeps this value. This is the
  1752. 1:10:53most basic memory
  1753. 1:10:55that we can use in in sequential logic
  1754. 1:10:59gates.
  1755. 1:11:02But people are designing better ones.
  1756. 1:11:04One of them is SR latch.
  1757. 1:11:07This is the most basic one.
  1758. 1:11:09Cross-coupled inverters, but it has only
  1759. 1:11:11inputs. But people are designing more
  1760. 1:11:13complex one, more useful ones. One of
  1761. 1:11:15them is SR latch.
  1762. 1:11:17People build SR latch by using NOR gates
  1763. 1:11:21in a similar way
  1764. 1:11:23in a similar way to the inverters.
  1765. 1:11:25People cross-couple the NOR gates in
  1766. 1:11:28this way.
  1767. 1:11:30And now it has two inputs.
  1768. 1:11:33R input for reset and S input for set.
  1769. 1:11:37And in this circuit you can do it
  1770. 1:11:40you can try it in in in home. Whenever
  1771. 1:11:43you apply
  1772. 1:11:44one to R
  1773. 1:11:46it gives zero
  1774. 1:11:48at this Q output. Whenever you apply one
  1775. 1:11:51to S, it gives one in here.
  1776. 1:11:55So, in order to reset it, reset means
  1777. 1:11:57that you are setting Q as zero, you can
  1778. 1:12:00apply one to R R input. And in order to
  1779. 1:12:04set it, you can apply one to S input.
  1780. 1:12:08And whenever S is zero and R R is zero,
  1781. 1:12:11it keeps this value. So, Q keeps the
  1782. 1:12:14previous value of Q. So, it keeps the
  1783. 1:12:15value.
  1784. 1:12:18In this SR latch, you shouldn't by the
  1785. 1:12:20way, there is a forbidden input
  1786. 1:12:22combination. You shouldn't apply S one
  1787. 1:12:27and R one at the same time.
  1788. 1:12:29Because if you apply S one and R one at
  1789. 1:12:32the same time, you don't know the output
  1790. 1:12:33value. It is unknown. It's for For this
  1791. 1:12:36reason, it is forbidden state.
  1792. 1:12:38So, SR latch is more useful one because
  1793. 1:12:40you have R and S inputs. So, if you want
  1794. 1:12:43to set it, you only can apply one to S
  1795. 1:12:45input. And if you want to reset it, you
  1796. 1:12:47want to apply one to R input.
  1797. 1:12:50And people use this SR latch
  1798. 1:12:53to build a D latch.
  1799. 1:12:57Uh
  1800. 1:12:57By the way, yeah, you can use D latch SR
  1801. 1:13:00latch to build a D latch, but in here
  1802. 1:13:02there is a different methodology to
  1803. 1:13:04build a D latch.
  1804. 1:13:05In this D latch, we have a clock input.
  1805. 1:13:10This clock is can be zero and one.
  1806. 1:13:12But whenever clock is one,
  1807. 1:13:15if you apply a D input to this D input,
  1808. 1:13:20it stores this value in here in SR
  1809. 1:13:23latch. Yeah, here is SR latch.
  1810. 1:13:27Uh yeah, in here we we used SR latch to
  1811. 1:13:29build it, okay?
  1812. 1:13:31We used SR latch to build a D flip flop
  1813. 1:13:34D latch. So, in this D latch, whenever
  1814. 1:13:37clock comes here,
  1815. 1:13:39this here is SR latch part.
  1816. 1:13:42But in front of the SR latch, I am
  1817. 1:13:44putting AND gates,
  1818. 1:13:46and this AND gate is actually prevents
  1819. 1:13:50us from this state,
  1820. 1:13:52applying S and R one at the same time.
  1821. 1:13:54It prevents.
  1822. 1:13:56And in this
  1823. 1:13:58AND gates,
  1824. 1:14:00we connected a clock input and D input,
  1825. 1:14:03and not of D goes to this AND gate, and
  1826. 1:14:07the functionality is as follows.
  1827. 1:14:09Whenever this clock is one,
  1828. 1:14:11whenever clock is one,
  1829. 1:14:13D passes its input to this SR latch, so
  1830. 1:14:17this SR latch stores this D. But
  1831. 1:14:20whenever this clock is zero, it it keeps
  1832. 1:14:23the value that it has stored in here.
  1833. 1:14:27It holds the its previous value.
  1834. 1:14:29So, whenever clock is one, it is
  1835. 1:14:31transparent. Transparent means that D is
  1836. 1:14:34goes
  1837. 1:14:35to here, and whenever clock is zero,
  1838. 1:14:38it is opaque. It means that it doesn't
  1839. 1:14:40pass this D to
  1840. 1:14:42SR latch.
  1841. 1:14:45And this clock is
  1842. 1:14:47you can think it as an enable. Whenever
  1843. 1:14:50enable is one,
  1844. 1:14:51it stores the D in here. Whenever enable
  1845. 1:14:53is zero, it doesn't store anything. So,
  1846. 1:14:56it keeps its previous value.
  1847. 1:14:59And by using this
  1848. 1:15:01Okay, this were the latch.
  1849. 1:15:03Okay?
  1850. 1:15:05And I told that there are latches and
  1851. 1:15:08flip-flops.
  1852. 1:15:10Flip-flops are a little bit different
  1853. 1:15:12than latches.
  1854. 1:15:14Uh and we can build a flip-flop by using
  1855. 1:15:17two
  1856. 1:15:19latches, two D latches.
  1857. 1:15:24In here,
  1858. 1:15:25we have two D latches. They are two
  1859. 1:15:27latch D latches, two D latches.
  1860. 1:15:30And we are connecting a clock to them.
  1861. 1:15:33You can think clock as enable, okay?
  1862. 1:15:38Whenever this clock
  1863. 1:15:41is
  1864. 1:15:42becoming one,
  1865. 1:15:45this D is sampled in here.
  1866. 1:15:47Whenever this clock is zero
  1867. 1:15:51or not moving,
  1868. 1:15:52there is nothing stored in here.
  1869. 1:15:56Uh maybe I can mention about Yes, I can
  1870. 1:15:58mention about the functionality
  1871. 1:16:01how it is behave so.
  1872. 1:16:04I I'm I mentioned about the latch,
  1873. 1:16:06right? So, latch says that whenever here
  1874. 1:16:09is one, it passes
  1875. 1:16:11this D and stores it in here.
  1876. 1:16:14Whenever this clock is one, it
  1877. 1:16:16this stores
  1878. 1:16:18the value at the D input inside the SR
  1879. 1:16:20latch, okay?
  1880. 1:16:23This
  1881. 1:16:24flip-flop is uh
  1882. 1:16:26behaves a little bit differently. Uh
  1883. 1:16:30In the previous case,
  1884. 1:16:34for example, we can generate a clock
  1885. 1:16:36signal. This is a clock signal.
  1886. 1:16:39This latch was sampling this D input
  1887. 1:16:42while clock is one.
  1888. 1:16:45But in flip-flop, we can draw a clock
  1889. 1:16:48again.
  1890. 1:16:50This flip-flop, this is a flip-flop.
  1891. 1:16:53This flip-flop stores the value at D at
  1892. 1:16:56the rising edge of the clock. How?
  1893. 1:17:00I can go because this is a D flip-flop,
  1894. 1:17:03by the way.
  1895. 1:17:04This is a D flip-flop. This is a
  1896. 1:17:06corresponding symbol of it.
  1897. 1:17:09So,
  1898. 1:17:11this is the This is my clock signal.
  1899. 1:17:14And Q is our
  1900. 1:17:16corresponds to value stored, okay? Well,
  1901. 1:17:18this is the value stored.
  1902. 1:17:20Whenever clock is rising, think for
  1903. 1:17:24example, at the beginning, clock is
  1904. 1:17:26zero, okay? If clock is zero,
  1905. 1:17:29this zero goes to this latch as one
  1906. 1:17:32because there is an inverter in here.
  1907. 1:17:34So, clock zero means that this latch
  1908. 1:17:37gets the clock as one because it it
  1909. 1:17:39takes the not of the clock.
  1910. 1:17:41So, whenever this clock is one,
  1911. 1:17:44this SR latch samples D in here. So,
  1912. 1:17:47this Q corresponds to D and one. The N1
  1913. 1:17:51corresponds to D. It keeps the D value,
  1914. 1:17:54okay?
  1915. 1:17:55But at the same time, the clock in here,
  1916. 1:17:58it is a directly connected to clock.
  1917. 1:18:00This clock input is connected to
  1918. 1:18:02directly clock. It is zero. So, it
  1919. 1:18:04doesn't pass through here. It doesn't
  1920. 1:18:07pass through here. So, Q keeps the
  1921. 1:18:09previous value because whenever clock
  1922. 1:18:11was zero in latch, it was giving the
  1923. 1:18:12previous value.
  1924. 1:18:15Okay?
  1925. 1:18:16So,
  1926. 1:18:17at this point,
  1927. 1:18:19in here, the first latch sampled this D
  1928. 1:18:22value,
  1929. 1:18:24but it is in here between two latches in
  1930. 1:18:28in this N1 value.
  1931. 1:18:30So, whenever this clock goes from zero
  1932. 1:18:32to one,
  1933. 1:18:34in this case, clock goes zero to one. It
  1934. 1:18:38means that here is becoming zero, here
  1935. 1:18:41is becoming one.
  1936. 1:18:43If here becomes zero, this connection is
  1937. 1:18:46closed, right?
  1938. 1:18:48This D is stored in here, and when this
  1939. 1:18:52clock becomes one, at that time, this D
  1940. 1:18:55passes to here
  1941. 1:18:57while this clock becomes zero to one.
  1942. 1:19:00This value at the previous value at the
  1943. 1:19:03N1 location passes to this second latch,
  1944. 1:19:07and Q corresponds to D.
  1945. 1:19:10So, in this case, we can say that
  1946. 1:19:13while clock is rising, this flip-flop
  1947. 1:19:15sampling. Did Did you understand it? Can
  1948. 1:19:18You understand, right?
  1949. 1:19:20Because this this latch works while
  1950. 1:19:22clock is zero sample clock is zero, and
  1951. 1:19:25this latch samples while clock is one.
  1952. 1:19:27So, while switching from zero to one,
  1953. 1:19:30this value passes to here, and it
  1954. 1:19:32samples It means that it samples while
  1955. 1:19:35at the rising edge of clock.
  1956. 1:19:37So, in latch,
  1957. 1:19:40we are sampling at the edge of the
  1958. 1:19:42clock.
  1959. 1:19:43Uh
  1960. 1:19:44sorry, not at at the level.
  1961. 1:19:47If clock is one or zero. By the way,
  1962. 1:19:49there are reverse latches. For example,
  1963. 1:19:51you can get the inverse of it. You can
  1964. 1:19:54sample at zero. It is It is You can do
  1965. 1:19:56it in this way. But generally speaking,
  1966. 1:20:00in latch,
  1967. 1:20:01you sample at the level.
  1968. 1:20:04And in D flip-flop in flip-flops, you
  1969. 1:20:06sample at the edge.
  1970. 1:20:09At the edge.
  1971. 1:20:11Uh By the way, maybe until now,
  1972. 1:20:14maybe in the last four five years, I
  1973. 1:20:16interviewed maybe around 500
  1974. 1:20:19uh electrical electronics engineering
  1975. 1:20:21students, and maybe 90% of the students
  1976. 1:20:23didn't know it. Didn't know the
  1977. 1:20:25difference between the latch and
  1978. 1:20:26flip-flop.
  1979. 1:20:29According to the statistic that I got
  1980. 1:20:31from my interviews, job interviews. So,
  1981. 1:20:34this is a important concept for
  1982. 1:20:36logic digital design.
  1983. 1:20:39Latches sample at the edge at the level.
  1984. 1:20:42So, they are level triggered and
  1985. 1:20:44flip-flops samples at the edge.
  1986. 1:20:47And we are using clock for to generate
  1987. 1:20:49the enable signals actually. Clocks are
  1988. 1:20:51at the enable signals.
  1989. 1:20:54So, here is a description.
  1990. 1:20:59So, when clock is zero, so that's that
  1991. 1:21:02what I mentioned to you.
  1992. 1:21:05Okay.
  1993. 1:21:07And by using these
  1994. 1:21:10flip-flops, we are building finite state
  1995. 1:21:12machines. You have to be familiar about
  1996. 1:21:14them. And there are two finite state
  1997. 1:21:16machines, Moore and Mealy FSM finite
  1998. 1:21:19state machines.
  1999. 1:21:21Uh
  2000. 1:21:21these are used to to keep the states.
  2001. 1:21:24And in this finite state machines,
  2002. 1:21:27depending on the input, our state is
  2003. 1:21:29changing.
  2004. 1:21:30Uh and a finite state machine consists
  2005. 1:21:32of
  2006. 1:21:33two
  2007. 1:21:35parts. One of them is a state register
  2008. 1:21:36that keeps the current state.
  2009. 1:21:39And other one is the combination logic.
  2010. 1:21:41It depends combination logic computes
  2011. 1:21:43the next state and also computes the
  2012. 1:21:45output at the same time.
  2013. 1:21:49Uh by the way, a complex processor is
  2014. 1:21:51also a finite state machine. In digital
  2015. 1:21:54design,
  2016. 1:21:56uh everything nearly, if you are using a
  2017. 1:21:58flip-flop to keep state, everything is
  2018. 1:22:02we can say that everything is a finite
  2019. 1:22:03state machine.
  2020. 1:22:05And in this finite state machine, next
  2021. 1:22:06state is determined by the current state
  2022. 1:22:08and inputs.
  2023. 1:22:11There are two types of it, Moore and
  2024. 1:22:13Mealy. Uh
  2025. 1:22:15actually, we don't care much Moore or
  2026. 1:22:17Mealy. While designing the complex
  2027. 1:22:19processors, we are writing hardware
  2028. 1:22:21description languages for this. We don't
  2029. 1:22:23care much whether it is Moore or Mealy.
  2030. 1:22:25we don't care it.
  2031. 1:22:39I will briefly mention about also timing
  2032. 1:22:41and power.
  2033. 1:22:43Combinational logic gates has timing
  2034. 1:22:47because signal travels. So, how signal
  2035. 1:22:50travels?
  2036. 1:22:51For example, when you apply a signal
  2037. 1:22:54to here,
  2038. 1:22:56it is not like light.
  2039. 1:22:58For example, when you apply a logic one
  2040. 1:23:00to here, it doesn't goes to be
  2041. 1:23:02immediately because it is not just a
  2042. 1:23:04wire. It is when you look at it,
  2043. 1:23:07actually there is a resistor in here and
  2044. 1:23:09there is a capacitor in here.
  2045. 1:23:11These are named as parasitics.
  2046. 1:23:14So, in order to For example, if we apply
  2047. 1:23:17a one logic one to here, in order to get
  2048. 1:23:20a one in B, we have to fill this
  2049. 1:23:23capacitor. So, that this capacitor at
  2050. 1:23:25the output it gives to be
  2051. 1:23:28the value to be.
  2052. 1:23:29So, it takes time to fill this capacitor
  2053. 1:23:32because electrons are moving
  2054. 1:23:35and these electrons fills this capacitor
  2055. 1:23:37and whenever this capacitor fills, this
  2056. 1:23:39B gets one. But, it's very fast by the
  2057. 1:23:41way, yeah. For example, in
  2058. 1:23:43in 16 nanometer technology, if you are
  2059. 1:23:45using an AND gate,
  2060. 1:23:46uh delay is maybe 5 picosecond. It is
  2061. 1:23:49very fast.
  2062. 1:23:51But, there is there are delays. And in
  2063. 1:23:54combinational logic gate, uh for this
  2064. 1:23:56reason, there is a concept of critical
  2065. 1:23:58path. Critical path corresponds to path
  2066. 1:24:02that is the slowest one.
  2067. 1:24:07For example, in here, I have a D. Uh
  2068. 1:24:10this D input just goes this AND gate and
  2069. 1:24:13goes to Y output, changes the Y output.
  2070. 1:24:16This is a very fast path.
  2071. 1:24:18But, corre- when you look at the path
  2072. 1:24:20between A and Y, this path is goes loss
  2073. 1:24:24of gates in and in each gate there are
  2074. 1:24:28parasitics.
  2075. 1:24:30Resistor and capacitor. So, while going
  2076. 1:24:33through each gate
  2077. 1:24:35time passes.
  2078. 1:24:36So, this is the critical path, for
  2079. 1:24:38example. In here, most likely this is
  2080. 1:24:39the critical path. It doesn't We don't
  2081. 1:24:41know. We need to use
  2082. 1:24:43synthesis tools. This is the By the way,
  2083. 1:24:48implementation
  2084. 1:24:49actual implementation of the integrated
  2085. 1:24:51circuit is the uh
  2086. 1:24:56Uh but, of course, you need to do
  2087. 1:24:58implementation and look at the result.
  2088. 1:24:59But, most likely this is the critical
  2089. 1:25:01path in here. So, critical path means
  2090. 1:25:04that when you apply a signal to here,
  2091. 1:25:07and this signal, the change in this
  2092. 1:25:09signal
  2093. 1:25:10reflects to here, uh
  2094. 1:25:13but it takes time, more time compared to
  2095. 1:25:16other ones. It is the longest path.
  2096. 1:25:19When you look at this path, for example,
  2097. 1:25:21the critical path in here from between A
  2098. 1:25:24and Y, it corresponds to two AND gates.
  2099. 1:25:28Two AND gates.
  2100. 1:25:30Uh
  2101. 1:25:31This is first AND gate, this is second
  2102. 1:25:34AND gate, and one OR gate. It takes the
  2103. 1:25:37two It needs to pass through two AND
  2104. 1:25:38gate and one OR gate. And when you look
  2105. 1:25:40at the short path, it needs to go
  2106. 1:25:43through one AND gate.
  2107. 1:25:45And there are concept of max and min
  2108. 1:25:46delay.
  2109. 1:25:49So, in here, the important thing is that
  2110. 1:25:54for example, since
  2111. 1:25:58you don't know, for example, inside
  2112. 1:26:00while driving this circuit, for example,
  2113. 1:26:02you are driving some input to here and
  2114. 1:26:04getting some output to here,
  2115. 1:26:07since you don't know which input is
  2116. 1:26:09changing,
  2117. 1:26:10you have to set your circuit operating
  2118. 1:26:13frequency
  2119. 1:26:14regarding the longest path.
  2120. 1:26:16That's why, for example, people are
  2121. 1:26:18saying that our processor is working at
  2122. 1:26:212 GHz. It means that the critical path
  2123. 1:26:23inside the this processor
  2124. 1:26:26uh corresponding to 0.5 ns.
  2125. 1:26:29Because 0.5 ns means that 2 GHz.
  2126. 1:26:32>> Mhm.
  2127. 1:26:32>> So,
  2128. 1:26:34by the way, the critical path
  2129. 1:26:36decides on the maximum running
  2130. 1:26:38frequency.
  2131. 1:26:43In here, there are some called steps in
  2132. 1:26:45combination logic gate timing.
  2133. 1:26:47Uh delay, as I told you, it is the time
  2134. 1:26:49between input change and output change.
  2135. 1:26:52Uh there are two types of delays,
  2136. 1:26:54propagation delay and contamination
  2137. 1:26:56delay. Propagation delay is actually
  2138. 1:26:58maximum delay.
  2139. 1:27:00And contamination delay is the minimum
  2140. 1:27:01delay. So, in here, for example,
  2141. 1:27:04propagation delay, we can say that, for
  2142. 1:27:06example, the maximum of this one and
  2143. 1:27:09contamination is the minimum.
  2144. 1:27:11From D to Y is the contamination, A to Y
  2145. 1:27:13is the
  2146. 1:27:15uh maximum one.
  2147. 1:27:18But, it is not always the input and
  2148. 1:27:20output paths. Sometimes, even, for
  2149. 1:27:23example, you have a gate, for example, A
  2150. 1:27:25and B, and you have a output in here.
  2151. 1:27:29For example, maybe this A to Y change is
  2152. 1:27:31faster than B to Y change. So, in this
  2153. 1:27:34case, B to Y is the maximum delay, A to
  2154. 1:27:37Y is minimum delay.
  2155. 1:27:40And even sometimes, for example, think
  2156. 1:27:43you have a single buffer.
  2157. 1:27:46And it has a single input and single
  2158. 1:27:48output.
  2159. 1:27:49It has a simple concept of mean and max
  2160. 1:27:52delays.
  2161. 1:27:53How?
  2162. 1:27:54Uh because it change some with uh PVT.
  2163. 1:27:59Uh
  2164. 1:28:00PVT means that process, V means voltage,
  2165. 1:28:03T means temperature.
  2166. 1:28:05Uh process,
  2167. 1:28:07don't worry about process.
  2168. 1:28:09It is the
  2169. 1:28:11topic of the next course. But, for
  2170. 1:28:12example, sometimes as I told you, it is
  2171. 1:28:15not exactly VDD. It is maybe 0.8 0.
  2172. 1:28:19between 0.8 and 0.7.
  2173. 1:28:22So, if for example, this
  2174. 1:28:24voltage, for example, applied voltage to
  2175. 1:28:27this buffer is 0.7 V,
  2176. 1:28:30this gate is a little bit slower because
  2177. 1:28:33it is voltage is less than the nominal
  2178. 1:28:35one. So,
  2179. 1:28:37if it is 0.8, it is faster.
  2180. 1:28:40So, still
  2181. 1:28:42there is a even if there is a single
  2182. 1:28:45input, there is a range
  2183. 1:28:48between min and max, and we need to care
  2184. 1:28:50about it still. For example, for this
  2185. 1:28:53buffer
  2186. 1:28:55A,
  2187. 1:28:56whenever we apply an input to here, for
  2188. 1:28:58example, we apply an input in here. We
  2189. 1:29:01applied a new input at this point,
  2190. 1:29:04and it takes some time
  2191. 1:29:06to be reflected at the Y point.
  2192. 1:29:09So, and it has a subtle minimum and
  2193. 1:29:12maximum delays.
  2194. 1:29:15So, the minimum one is that, for
  2195. 1:29:18example, you apply a input to A, you
  2196. 1:29:21change the input at the A, maybe minimum
  2197. 1:29:23is 1 nanosecond, it change after 1
  2198. 1:29:25nanosecond, and maximum is
  2199. 1:29:282 nanosecond.
  2200. 1:29:30So, it can be the earliest one
  2201. 1:29:33is after 1 nanosecond, and latest one is
  2202. 1:29:35after 2 nanosecond. So, it can be any
  2203. 1:29:38time between 1 nanosecond and 2
  2204. 1:29:40nanosecond, but not between before 1
  2205. 1:29:43nanosecond and after 2 nanosecond.
  2206. 1:29:45So, it has a still concept of
  2207. 1:29:48minimum and maximum delay even if it is
  2208. 1:29:51a single input.
  2209. 1:29:52And this is very important. Why it has a
  2210. 1:29:55minimum and a maximum? Because the
  2211. 1:29:57voltage changes in here. While, for
  2212. 1:29:59example, you connected billion of
  2213. 1:30:01transistors, some of them getting 0.8
  2214. 1:30:040.8 V, some of them is getting 0.75
  2215. 1:30:07volts. Some of them is getting 0.78
  2216. 1:30:10volts. It changes. Temperature also
  2217. 1:30:12changes. In your IC, for example, some
  2218. 1:30:15place of the IC is 85 degree, some
  2219. 1:30:17places 84 degree. The even these
  2220. 1:30:20temperature differences create small
  2221. 1:30:22differences between this delay. For this
  2222. 1:30:24reason, while designing designing the
  2223. 1:30:28logic digital designs, we have a concept
  2224. 1:30:30of minimum and maximum delays always.
  2225. 1:30:34And this delay is caused also by
  2226. 1:30:35capacitance and resistance in a circuit,
  2227. 1:30:38not only PVT.
  2228. 1:30:40PVT is important. By the way, process is
  2229. 1:30:43the quality of the transistor. Sometimes
  2230. 1:30:46transistor quality is not good. So, at
  2231. 1:30:48that time P corresponds to process, by
  2232. 1:30:50the way. At that time
  2233. 1:30:52the for example, NMOS transistor is
  2234. 1:30:55maybe or or under function.
  2235. 1:30:57Less performance, providing less
  2236. 1:30:59performance.
  2237. 1:31:01It
  2238. 1:31:02delay is caused by
  2239. 1:31:03uh PVT. Delay differences caused by PVT
  2240. 1:31:06and also capacitance and resistance
  2241. 1:31:08causing the delay also.
  2242. 1:31:10So, why we have a
  2243. 1:31:12propagation and contamination concepts
  2244. 1:31:15uh because
  2245. 1:31:17yeah, PVT differences. And also another
  2246. 1:31:20one that I mentioned about.
  2247. 1:31:23For example, this A is changing in here.
  2248. 1:31:25This also another another stuff that
  2249. 1:31:28leads to different propagation and
  2250. 1:31:30contamination delay. If you drive this A
  2251. 1:31:33very sharply,
  2252. 1:31:34then you get very fast response in here.
  2253. 1:31:36But what about if you drive it very
  2254. 1:31:38slowly?
  2255. 1:31:40You are getting
  2256. 1:31:41slower response at Y. Also, it also
  2257. 1:31:44changes
  2258. 1:31:45how sharply apply this A input to here.
  2259. 1:31:49And most likely this A input is output
  2260. 1:31:51of another gate. And if this gate drives
  2261. 1:31:53it sharply,
  2262. 1:31:55Y also gives the output very fastly. But
  2263. 1:31:58if it doesn't, Y Y is also slower.
  2264. 1:32:03And also multiple in outputs I mentioned
  2265. 1:32:05that in here there are multiple inputs
  2266. 1:32:07and outputs and each of them has a
  2267. 1:32:09different delay.
  2268. 1:32:11And circuits slow down generally when
  2269. 1:32:13hot and speed up when cold.
  2270. 1:32:16Yes.
  2271. 1:32:19Process voltage temperature TVT.
  2272. 1:32:22Process how the trans quality of the
  2273. 1:32:24transistor
  2274. 1:32:25while manufacturing because you are not
  2275. 1:32:27getting there are billion of transistors
  2276. 1:32:29and you are not getting the same quality
  2277. 1:32:31quality every time.
  2278. 1:32:33And temperature is the actual
  2279. 1:32:34temperature.
  2280. 1:32:36It changes inside a processor.
  2281. 1:32:38Temperature is different in the in the
  2282. 1:32:41die. Die means IC by the way.
  2283. 1:32:44And voltage is also different.
  2284. 1:32:50And the there are in this is for the
  2285. 1:32:53combinational logic gate timing.
  2286. 1:32:56And in sequential
  2287. 1:32:58logic circuits especially for flip-flops
  2288. 1:33:00there are also some timing
  2289. 1:33:02knowledge.
  2290. 1:33:04But maybe
  2291. 1:33:08is it better to give a break, right? We
  2292. 1:33:10we started at 50
  2293. 1:33:12and now it is okay. We we can give a
  2294. 1:33:13break maybe 15 minutes break and then
  2295. 1:33:16continue.
  2296. 1:33:19We can we can start at 55.
  2297. 1:33:41So related to sequential circuits
  2298. 1:33:44flip-flop timing
  2299. 1:33:46flip-flop samples at D samples D at
  2300. 1:33:49clock edge and D must be stable while
  2301. 1:33:51sampled.
  2302. 1:33:52So
  2303. 1:33:53the point in here is that
  2304. 1:33:56for example I told you that while clock
  2305. 1:33:58is
  2306. 1:34:00clock is rising
  2307. 1:34:02while clock is rising, this flip-flop
  2308. 1:34:06is sampling this D.
  2309. 1:34:09But, what if D changes
  2310. 1:34:11in here while sampling?
  2311. 1:34:14This is a timing violation because there
  2312. 1:34:17are some rules in here you need to obey.
  2313. 1:34:21And these rules are summarized as setup
  2314. 1:34:23time and hold time.
  2315. 1:34:25Uh setup time is the time before clock
  2316. 1:34:28edge data must be stable. So, it's you
  2317. 1:34:31can think at it as a taking photograph.
  2318. 1:34:34For example, while running if you take a
  2319. 1:34:36photograph, your picture will not be
  2320. 1:34:39clear.
  2321. 1:34:42So, while taking a photograph
  2322. 1:34:44photograph, you must be you must be
  2323. 1:34:47stable actually. You you shouldn't move.
  2324. 1:34:50And
  2325. 1:34:51also while taking for example, it
  2326. 1:34:54sampled you the photograph
  2327. 1:34:56the photograph machine sampled you, also
  2328. 1:34:58you need to keep stable a little bit
  2329. 1:35:00more because while sampling it's is
  2330. 1:35:03it's still sampling, so you have to be
  2331. 1:35:05you have to be stable.
  2332. 1:35:08And you can think the setup and hold
  2333. 1:35:10time in a similar way.
  2334. 1:35:12While sampling, the setup time is the
  2335. 1:35:14time
  2336. 1:35:15before sampling, you have to be stable.
  2337. 1:35:18The input at the D must be stable.
  2338. 1:35:21And hold time is the time after clock
  2339. 1:35:25edge after this clock edge you have to
  2340. 1:35:28keep the D stable.
  2341. 1:35:31So, you have to be stable before the
  2342. 1:35:33clock edge and you have to be stable
  2343. 1:35:35after the clock edge also.
  2344. 1:35:39If you change the D input during this
  2345. 1:35:42period, during this interval we don't
  2346. 1:35:44know what is stored in flip-flop. This
  2347. 1:35:47is the violation of timing. We don't
  2348. 1:35:48know. In this case, the circuit doesn't
  2349. 1:35:50behave correctly.
  2350. 1:35:53The setup time is the time before the
  2351. 1:35:56clock edge it must be stable and hold
  2352. 1:35:58time is the time after the clock edge it
  2353. 1:36:01must be stable. Input must be stable and
  2354. 1:36:03aperture time is the
  2355. 1:36:06the combination window of setup and hold
  2356. 1:36:08time. So during that time uh
  2357. 1:36:11the during the aperture time the D must
  2358. 1:36:14be stable.
  2359. 1:36:15It is the combination of setup and hold
  2360. 1:36:17time.
  2361. 1:36:18And in here also the similar similar to
  2362. 1:36:21the
  2363. 1:36:22the
  2364. 1:36:23combination logic gates we have a
  2365. 1:36:24propagation delay and contamination
  2366. 1:36:26delay concepts still. Propagation is the
  2367. 1:36:29maximum delay, contamination is the
  2368. 1:36:30minimum delay.
  2369. 1:36:32The
  2370. 1:36:33propagation delay the T propagation
  2371. 1:36:36clock to Q. It means that
  2372. 1:36:41this
  2373. 1:36:42uh D input
  2374. 1:36:43it means that time after clock edge that
  2375. 1:36:46Q is guaranteed to be stable
  2376. 1:36:49to stop changing. Means that for example
  2377. 1:36:51you have a flip-flop, okay?
  2378. 1:36:54You have a D input in here and Q
  2379. 1:36:57output in here and when clock comes you
  2380. 1:36:59are sampling this D, right? And this D
  2381. 1:37:02must be stable during aperture time.
  2382. 1:37:05It means that setup and hold time. Setup
  2383. 1:37:07plus hold time.
  2384. 1:37:09And also it takes some time to
  2385. 1:37:13to take the D and pass it to to Q
  2386. 1:37:17because in here there are gates, right?
  2387. 1:37:19These gates must
  2388. 1:37:21forward the signal.
  2389. 1:37:22And
  2390. 1:37:24the clock comes and the
  2391. 1:37:27change at the D reflects to Q.
  2392. 1:37:31During that time the time that passes
  2393. 1:37:32named as propagation delay, but this is
  2394. 1:37:34the maximum of it.
  2395. 1:37:36So
  2396. 1:37:38when this clock comes
  2397. 1:37:42the Q
  2398. 1:37:44output change depending on this D input
  2399. 1:37:47and this time the maximum of it is named
  2400. 1:37:50as propagation, and minimum of it
  2401. 1:37:53contained as contamination. So, there
  2402. 1:37:55are two versions. Maximum clock to Q
  2403. 1:37:58delay. This CQ means that clock to Q
  2404. 1:38:00delay.
  2405. 1:38:02So, when clock comes
  2406. 1:38:05to reflection on the Q takes time. So,
  2407. 1:38:07there is a maximum and minimum of it.
  2408. 1:38:10So, when you look at it,
  2409. 1:38:13when you look at this flip-flop diagram,
  2410. 1:38:17the input in here, it must be stable
  2411. 1:38:21before the clock edge, at least T setup
  2412. 1:38:23time, and it must be it must be stable
  2413. 1:38:25after the clock edge during this T hold
  2414. 1:38:27period, and the combination of these two
  2415. 1:38:30period is named as aperture time.
  2416. 1:38:33And propagation delay means that after
  2417. 1:38:36this clock comes, when this clock rises,
  2418. 1:38:39we are sampling this a D, right? Okay,
  2419. 1:38:42there is a D input in here, and we are
  2420. 1:38:44sampling it.
  2421. 1:38:46And there is a time.
  2422. 1:38:47The maximum time is the propagation
  2423. 1:38:50time, minimum one is the contamination
  2424. 1:38:52time, and it changes.
  2425. 1:38:54So, when clock comes, this D input
  2426. 1:38:58is reflected to Q, output at Q.
  2427. 1:39:02And earliest time
  2428. 1:39:04you can see it at after contamination
  2429. 1:39:07delay, and maximum you can see it after
  2430. 1:39:09propagation delay, and between them.
  2431. 1:39:12But,
  2432. 1:39:14it is guaranteed that after in this
  2433. 1:39:17point you cannot see it. It must become
  2434. 1:39:20before propagation and after
  2435. 1:39:22contamination, between them.
  2436. 1:39:24It is guaranteed. Otherwise, we cannot
  2437. 1:39:26build circuits. We need to [snorts] know
  2438. 1:39:28these propagation delay and
  2439. 1:39:29contamination delays.
  2440. 1:39:31And this propagation delay and
  2441. 1:39:33contamination delay are characteristic
  2442. 1:39:35to flip-flop. They are given. If if they
  2443. 1:39:36are designing a flip-flop, for example,
  2444. 1:39:38we are using a flip-flop, Uh,
  2445. 1:39:40we need to know its contamination and
  2446. 1:39:42propagation delay. Then they give it to
  2447. 1:39:44us.
  2448. 1:39:46And also they are giving us the setup
  2449. 1:39:48time and hold time. This is the specific
  2450. 1:39:50to
  2451. 1:39:51flip-flop.
  2452. 1:39:53And while designing a digital circuit,
  2453. 1:39:55we have to pay attention to them.
  2454. 1:39:59I will show how we are
  2455. 1:40:00using these values to compute our
  2456. 1:40:03maximum frequency. I will show.
  2457. 1:40:07What if we cannot pay attention to setup
  2458. 1:40:09and hold time?
  2459. 1:40:11Uh,
  2460. 1:40:11it leads to metastability.
  2461. 1:40:14Uh, so
  2462. 1:40:15in here, basically I can mention here
  2463. 1:40:18here there is a flip-flop and this is
  2464. 1:40:20the inside of flip-flop. Uh, yeah, this
  2465. 1:40:23is a
  2466. 1:40:24correspondence of flip-flop. Actually,
  2467. 1:40:27flip-flop is two latches.
  2468. 1:40:30But people use the
  2469. 1:40:32build a flip-flop by using inverters in
  2470. 1:40:34here, right? And here there are pass
  2471. 1:40:36gates.
  2472. 1:40:38And in here I will I will try to explain
  2473. 1:40:40how metastability in flip-flop happens.
  2474. 1:40:43So, assume that clock is zero and
  2475. 1:40:45becomes one.
  2476. 1:40:47Clock, this is our clock signal.
  2477. 1:40:50And
  2478. 1:40:51I have a D value and I am trying to
  2479. 1:40:53sample it to this D value.
  2480. 1:40:56When clock is zero,
  2481. 1:40:58this
  2482. 1:40:59gate passes because this is if not if
  2483. 1:41:03clock is zero, it means that clock is
  2484. 1:41:05not one. So, clock not is one. So, this
  2485. 1:41:08gate passes. Okay, this is the pass
  2486. 1:41:10gate.
  2487. 1:41:11This gate passes
  2488. 1:41:14D to A.
  2489. 1:41:16And this inverter, for example, assume
  2490. 1:41:19that D is one. D is one. This inverter
  2491. 1:41:23gives zero to here and this B
  2492. 1:41:26uh, gives C zero and this D becomes one.
  2493. 1:41:30Okay?
  2494. 1:41:31And here is open. This since clock is
  2495. 1:41:33zero, D here is open. Not con- not
  2496. 1:41:35connected.
  2497. 1:41:39So, after clock becomes one,
  2498. 1:41:42this
  2499. 1:41:44here is closed,
  2500. 1:41:46here is opened,
  2501. 1:41:49here is
  2502. 1:41:51closed.
  2503. 1:41:52O-
  2504. 1:41:53Uh I mean, yeah, here is
  2505. 1:41:54opened. Here is opened, also. It It
  2506. 1:41:57means that it's passing.
  2507. 1:41:59And this zero passes to here, and it
  2508. 1:42:01gives one to here, and this one
  2509. 1:42:04correspondingly gives zero to here. Here
  2510. 1:42:05is closed, also. This is a basic
  2511. 1:42:07flip-flop model.
  2512. 1:42:12This uh Yeah, you can check it, but this
  2513. 1:42:14is a basic flip-flop
  2514. 1:42:16also built by inverter gates. Normally,
  2515. 1:42:18I show you how to build flip-flop by SR
  2516. 1:42:20latch, but this is the version with
  2517. 1:42:22inverter gates. You can also build a
  2518. 1:42:24flip-flop by using inverter gates. And
  2519. 1:42:27these are the pass transistors.
  2520. 1:42:29Actually, this one corresponds to AND
  2521. 1:42:31gates. You can build them by using AND
  2522. 1:42:32gates.
  2523. 1:42:33But, the important point here is that I
  2524. 1:42:35will mention about the importance of the
  2525. 1:42:38setup and hold time. So, if clock is
  2526. 1:42:41Assume that clock is zero, okay?
  2527. 1:42:44And I have a D input
  2528. 1:42:48in here, some D input.
  2529. 1:42:53I have a setup and hold time
  2530. 1:42:56setup and hold time
  2531. 1:42:59margins in here.
  2532. 1:43:01And I assume that
  2533. 1:43:03this clock is zero. So, if this is zero,
  2534. 1:43:07here is opened. So, D passes to A.
  2535. 1:43:12Assume that D is at the beginning one,
  2536. 1:43:15okay?
  2537. 1:43:17And the circuit in here
  2538. 1:43:21gets the samples the D at one. So, here
  2539. 1:43:25is becoming
  2540. 1:43:26one, here is becoming zero, here is
  2541. 1:43:28zero, and here is one. Here is closed,
  2542. 1:43:31okay?
  2543. 1:43:35And
  2544. 1:43:36during that time, assume that this D
  2545. 1:43:39change in here very fastly.
  2546. 1:43:42For example,
  2547. 1:43:45assume that okay, I will change the D in
  2548. 1:43:48here, okay? D change in here. D became
  2549. 1:43:51one in after setup time.
  2550. 1:43:53Okay?
  2551. 1:43:55So,
  2552. 1:43:58assume that D change after setup time.
  2553. 1:44:00It means that it was zero before. D was
  2554. 1:44:03zero before. So, if it is zero, here was
  2555. 1:44:06be one. Here was
  2556. 1:44:08uh one and here was zero, okay?
  2557. 1:44:12If it is changed very close to the
  2558. 1:44:16edge of the clock,
  2559. 1:44:19assume that it change a little bit very
  2560. 1:44:22later than this T setup, okay?
  2561. 1:44:26So, assume that we we
  2562. 1:44:28make the D one, okay? Here became D one.
  2563. 1:44:32And
  2564. 1:44:33if here is one, this B starts to be
  2565. 1:44:36zero, okay?
  2566. 1:44:38Because this clock was this this gate
  2567. 1:44:40was closed, okay?
  2568. 1:44:43But
  2569. 1:44:44okay, it
  2570. 1:44:46D was one.
  2571. 1:44:47Since D one was one, this point B point
  2572. 1:44:51starts to be zero. But it was one before
  2573. 1:44:54and it starts it started to decrease to
  2574. 1:44:57to zero.
  2575. 1:45:00So, it was one, but it started to
  2576. 1:45:02decrease to zero.
  2577. 1:45:04Like zero. It was going to zero.
  2578. 1:45:06But immediately, since I changed the D
  2579. 1:45:09one
  2580. 1:45:10very close to the edge of the clock,
  2581. 1:45:12assume that clock changed and become
  2582. 1:45:15one.
  2583. 1:45:16So, immediately we close this gate.
  2584. 1:45:19We close this gate. We open this gate.
  2585. 1:45:21And it couldn't be zero exactly. It
  2586. 1:45:24stayed between them, between one and
  2587. 1:45:26zero. Did you see this point?
  2588. 1:45:28Because it couldn't change because it
  2589. 1:45:30was very close to edge of the clock and
  2590. 1:45:32we couldn't charge enough to this B
  2591. 1:45:34point. And the clock immediately changed
  2592. 1:45:37and closed here, open
  2593. 1:45:40closed here, opened here.
  2594. 1:45:42And at that point we don't know the
  2595. 1:45:44exact voltage in here. If we change the
  2596. 1:45:47this D input
  2597. 1:45:49after setup time window, we don't know
  2598. 1:45:52this value. That's why people are
  2599. 1:45:54putting setup and hold time constraints.
  2600. 1:45:57Otherwise, we don't know the value at B,
  2601. 1:45:59voltage at B.
  2602. 1:46:01We we don't guarantee it.
  2603. 1:46:04So, when we don't pay attention to this
  2604. 1:46:06setup time, in this case we don't know
  2605. 1:46:08the value at B. And if you don't know
  2606. 1:46:10know the value at B, we don't know value
  2607. 1:46:13at Q also. And it leads to
  2608. 1:46:15metastability.
  2609. 1:46:17So, this is the uh
  2610. 1:46:21this uh
  2611. 1:46:22measurement result.
  2612. 1:46:24People put a flip flop. This is a flip
  2613. 1:46:26flop. And assume that
  2614. 1:46:29this is this is the
  2615. 1:46:31uh
  2616. 1:46:31in here I can draw a clock for you also.
  2617. 1:46:34Assume that this is the clock.
  2618. 1:46:37People are provided a clock to to this
  2619. 1:46:40flip flop. This is the input on of this
  2620. 1:46:43flip flop and this is the output of this
  2621. 1:46:44flip flop.
  2622. 1:46:47And assume that
  2623. 1:46:49this flip flop has this time window.
  2624. 1:46:51This is a T setup time window and this
  2625. 1:46:54is a T hold time window.
  2626. 1:46:57And we didn't pay attention to this T
  2627. 1:46:59setup time and we changed this input
  2628. 1:47:02after setup time.
  2629. 1:47:05And people
  2630. 1:47:06tried it maybe thousand times and this
  2631. 1:47:08is the result.
  2632. 1:47:10Maybe for half of them, this flip flop
  2633. 1:47:12settles to one and for half of them, it
  2634. 1:47:15settles to zero.
  2635. 1:47:17So, we don't know the exact value. This
  2636. 1:47:18is why people are putting paying
  2637. 1:47:20attention while especially designing
  2638. 1:47:23digital circuits, we pay attention to
  2639. 1:47:25set up and hold times. Otherwise, we
  2640. 1:47:26don't know what's happening to this
  2641. 1:47:28flip-flop.
  2642. 1:47:29And
  2643. 1:47:31basically, this is set up and hold time.
  2644. 1:47:33As I told you, set up time, you have to
  2645. 1:47:35obey it, and it is the time before clock
  2646. 1:47:38edge data must be stable. And hold time,
  2647. 1:47:40time after clock edge data must be
  2648. 1:47:41stable stable. And hold time is also in
  2649. 1:47:45here, you can
  2650. 1:47:46check the whole time concepts.
  2651. 1:47:49Even after clock edge,
  2652. 1:47:52after clock edge comes,
  2653. 1:47:54if you change this D value,
  2654. 1:47:57and if this D value change change passes
  2655. 1:48:00through here, it also metastabilizes
  2656. 1:48:02this Q value also again.
  2657. 1:48:04So, that's why
  2658. 1:48:06important even after clock edge,
  2659. 1:48:09this D value shouldn't change. Okay,
  2660. 1:48:12after clock edge, you can think that
  2661. 1:48:13this is closed,
  2662. 1:48:15but very close to this clock edge,
  2663. 1:48:18it's still passing. It is not switching
  2664. 1:48:21immediately. It is switching slowly,
  2665. 1:48:23maybe in 5 picoseconds, 6 picoseconds.
  2666. 1:48:26So, during that time, while switching
  2667. 1:48:28this
  2668. 1:48:29this transistors off, you shouldn't
  2669. 1:48:32change the value also. This is also
  2670. 1:48:34important. Otherwise, you can see a
  2671. 1:48:36metastability in here.
  2672. 1:48:38And this is the real
  2673. 1:48:40oscilloscope results
  2674. 1:48:42that results the metastability.
  2675. 1:48:46So, we know the combinational circuit
  2676. 1:48:49timing, sequential circuit timing. Now,
  2677. 1:48:52we can do an example in here.
  2678. 1:48:54In here, I have a
  2679. 1:48:55circuit.
  2680. 1:48:56I have a flip-flops in here.
  2681. 1:48:59These flip-flops
  2682. 1:49:01getting some inputs, and these
  2683. 1:49:04at the rise of the clock,
  2684. 1:49:06these inputs are given to here.
  2685. 1:49:09And
  2686. 1:49:12in here, we are doing some
  2687. 1:49:14logic operations,
  2688. 1:49:16and in the next clock edge, we are
  2689. 1:49:18sampling the result of these
  2690. 1:49:21logic gates in this flip-flops, okay? In
  2691. 1:49:24here, we have a memory.
  2692. 1:49:25This memory gets its value at this clock
  2693. 1:49:28edge, and in the next clock edge
  2694. 1:49:31we are doing some computations in here,
  2695. 1:49:33and in the next clock edge we are
  2696. 1:49:35sampling it.
  2697. 1:49:39What's that?
  2698. 1:49:45So, in here, I assume that we have
  2699. 1:49:47flip-flops, and flip-flop has 60
  2700. 1:49:49picosecond
  2701. 1:49:50uh 60 picosecond setup time and 70
  2702. 1:49:53picosecond hold time. So, it means that
  2703. 1:49:56before the clock edge
  2704. 1:49:5760 picosecond, in this interval we
  2705. 1:50:00shouldn't change the input, and after 70
  2706. 1:50:03picosecond of this clock edge, we
  2707. 1:50:05shouldn't change the
  2708. 1:50:07uh f- input of the flip-flop.
  2709. 1:50:10And the basically, as I
  2710. 1:50:13drove in here
  2711. 1:50:16we have a clock. This clock actually is
  2712. 1:50:18common. This is common clock.
  2713. 1:50:21I drove this clock in here.
  2714. 1:50:23In the first rising edge of the clock we
  2715. 1:50:26are getting some input value from here,
  2716. 1:50:29and these flip-flops stores this input
  2717. 1:50:31value and gives this input value as the
  2718. 1:50:33output also. And during that time, after
  2719. 1:50:36getting the new input values to A B C D
  2720. 1:50:39points at this location, we are doing
  2721. 1:50:42some computations, logical computations
  2722. 1:50:44in here. And then new results
  2723. 1:50:47are
  2724. 1:50:48sampled in the next
  2725. 1:50:50flip-flop.
  2726. 1:50:54So, here is
  2727. 1:50:55Actually, people says that this is the
  2728. 1:50:57launch.
  2729. 1:50:58We are launching input, and this is the
  2730. 1:51:01capture.
  2731. 1:51:02We are launching input in here, and then
  2732. 1:51:05in the next rising edge, we are
  2733. 1:51:06capturing it. We are storing the result
  2734. 1:51:08in here.
  2735. 1:51:11So, I assume that setup time 60
  2736. 1:51:12picosecond, hold time 70 picosecond, and
  2737. 1:51:15for flip-flop maximum delay is 50
  2738. 1:51:18picosecond. The clock to Q delay. And
  2739. 1:51:21minimum is 30 picosecond.
  2740. 1:51:23And for each gate, our logic delay is 35
  2741. 1:51:26picosecond maximum and 25 picosecond
  2742. 1:51:28minimum.
  2743. 1:51:31So, when we look at here,
  2744. 1:51:36when we look at here,
  2745. 1:51:39uh
  2746. 1:51:40the what is the maximum path in here?
  2747. 1:51:43This is the maximum path. We are passing
  2748. 1:51:45through three gates.
  2749. 1:51:47And what is the maximum delay of these
  2750. 1:51:48three gates? So, for gates, the maximum
  2751. 1:51:52delay is 35 picosecond. So, when we
  2752. 1:51:54compute it three times 35 picosecond,
  2753. 1:51:56105 picosecond maximum delay.
  2754. 1:51:59But also we had some constraints for the
  2755. 1:52:03uh flip-flop.
  2756. 1:52:05Assume that there is a flip-flop in here
  2757. 1:52:08and another flip-flop in here, and we
  2758. 1:52:10are doing some combinational logic in
  2759. 1:52:12here.
  2760. 1:52:15In the In this for this flip-flop, data
  2761. 1:52:18must come before 35 picosecond sorry, 60
  2762. 1:52:23picosecond setup window.
  2763. 1:52:2560 picosecond setup window.
  2764. 1:52:29So,
  2765. 1:52:30we have 60 picosecond. Assume that this
  2766. 1:52:33is a our clock period. So,
  2767. 1:52:36this is period. One over period, by the
  2768. 1:52:38way, one over period is the frequency.
  2769. 1:52:41One over period is the frequency. So,
  2770. 1:52:43the our clock period is the time between
  2771. 1:52:46the clock edges.
  2772. 1:52:48So, when you look at it for setup time,
  2773. 1:52:50we can do a computation.
  2774. 1:52:54We have three gates. So, three gates at
  2775. 1:52:56105 picosecond gate delay, and we have a
  2776. 1:53:01setup time constraint of 60 picosecond.
  2777. 1:53:04And also I have a
  2778. 1:53:07uh propagation delay.
  2779. 1:53:10Maximum propagation delay, which is 50
  2780. 1:53:12second 50 picosecond.
  2781. 1:53:14So, this flip-flop gives 50 picosecond
  2782. 1:53:17takes 50 picosecond. This
  2783. 1:53:20because this takes 50 picosecond to come
  2784. 1:53:22here from clock to Q.
  2785. 1:53:24Here there is a 50 picosecond delay.
  2786. 1:53:27This
  2787. 1:53:28three logic gates gives 105 picoseconds.
  2788. 1:53:3250 after 105 picoseconds and I have also
  2789. 1:53:35in here a setup constraint that it must
  2790. 1:53:38come before the uh 60 picosecond before
  2791. 1:53:42the
  2792. 1:53:43clock edge. So, when you look at the
  2793. 1:53:44setup time constraint, 50 + 105 + 60
  2794. 1:53:50what 215 picosecond setup time
  2795. 1:53:53constraint. So, it means that this path
  2796. 1:53:55takes
  2797. 1:53:57255 picoseconds
  2798. 1:54:01this way. So, it means that
  2799. 1:54:05our maximum
  2800. 1:54:06uh by the way, our minimum period is 215
  2801. 1:54:0915 picosecond. So, when you compute the
  2802. 1:54:13frequency by using it, uh
  2803. 1:54:15it means it corresponds that uh this
  2804. 1:54:18circuit can can work at 4.65 GHz GHz.
  2805. 1:54:23It is one over period. It is frequency.
  2806. 1:54:26So, it is 4.65 GHz it can run.
  2807. 1:54:30How we are finding it? We are
  2808. 1:54:32combining the delays maximum delays to
  2809. 1:54:35find the maximum frequency. We are
  2810. 1:54:37looking to the slowest path
  2811. 1:54:39and we are combining the
  2812. 1:54:41uh maximum delays and also we are taking
  2813. 1:54:44the setup time constraint into
  2814. 1:54:46consideration because the input must be
  2815. 1:54:48ready before setup time. That setup time
  2816. 1:54:50was 60 picosecond.
  2817. 1:54:52So, the total path 215 picosecond and it
  2818. 1:54:55corresponds to 4.65 GHz.
  2819. 1:54:59What about hold time?
  2820. 1:55:01Hold time looks to the
  2821. 1:55:03shortest path, fastest path.
  2822. 1:55:06So, what about the fastest path?
  2823. 1:55:09Hold time,
  2824. 1:55:11to recap, hold time says that
  2825. 1:55:16in this flip-flop, in the rising clock
  2826. 1:55:19edge, okay, there is a setup time
  2827. 1:55:20constraint.
  2828. 1:55:22The data must be ready before the rising
  2829. 1:55:25edge of the clock at least by setup
  2830. 1:55:27time.
  2831. 1:55:28And after this rising edge, data must be
  2832. 1:55:33stable. New data should not come
  2833. 1:55:36during this T hold period time.
  2834. 1:55:39So, for example, for this flip-flop,
  2835. 1:55:42if this path
  2836. 1:55:44after this
  2837. 1:55:46flip-flop rises
  2838. 1:55:48and while it is sampling the data at
  2839. 1:55:51here,
  2840. 1:55:53this flip-flop, this path shouldn't
  2841. 1:55:55drive any data
  2842. 1:55:58before this T hold time.
  2843. 1:56:01Because while sampling this one,
  2844. 1:56:04T hold means that after the rising edge,
  2845. 1:56:07data must be stable. But after rising
  2846. 1:56:10edge, if this data changes so fastly,
  2847. 1:56:12very fastly, then it's still problem. It
  2848. 1:56:15leads to metastability.
  2849. 1:56:17So, for set hold time, we are looking to
  2850. 1:56:20do fastest path and we are taking to the
  2851. 1:56:24fastest
  2852. 1:56:26timing
  2853. 1:56:27uh values. So, what about the fastest
  2854. 1:56:30timing values?
  2855. 1:56:31There is a This is the fastest path, by
  2856. 1:56:33the way.
  2857. 1:56:34And this is a one and not NOR gate. And
  2858. 1:56:38for this NOR gate,
  2859. 1:56:40I am taking the fastest
  2860. 1:56:43uh
  2861. 1:56:45Sorry, not this one. I am taking the
  2862. 1:56:47fastest
  2863. 1:56:48uh contamination delay,
  2864. 1:56:50minimum delay. So, it is 25 picoseconds.
  2865. 1:56:54This is the fastest response time of
  2866. 1:56:57this gate. I'm
  2867. 1:56:59This time in while competing the setup
  2868. 1:57:00time, I took the 35 picosecond maximum.
  2869. 1:57:03But while
  2870. 1:57:05competing the whole time requirement, I
  2871. 1:57:07need to take the minimum because hold
  2872. 1:57:09time uh
  2873. 1:57:10is caused uh due to the fastest path.
  2874. 1:57:14Because after flip flop rises, if new
  2875. 1:57:17data comes very early,
  2876. 1:57:20this is the whole time violation. So, I
  2877. 1:57:22need to check this case and in order to
  2878. 1:57:24check check this case, I need to look at
  2879. 1:57:26the minimum time. So, for the the
  2880. 1:57:28minimum one, it is 25 picosecond plus
  2881. 1:57:31our whole time constraint,
  2882. 1:57:33uh
  2883. 1:57:34which is
  2884. 1:57:35uh whole time constraint is uh where is
  2885. 1:57:37it?
  2886. 1:57:38Uh whole time constraint is 70
  2887. 1:57:39picosecond, by the way. Yeah. This 25
  2888. 1:57:42picosecond minimum delay and also for
  2889. 1:57:45this flip flop minimum contamination
  2890. 1:57:48clock to Q minimum delay 30 picosecond.
  2891. 1:57:51So, 30 picosecond plus 25 picosecond 55
  2892. 1:57:5555 picosecond. When you look at whole
  2893. 1:57:57time constraint, it is 70 picosecond.
  2894. 1:58:00So, it means that there is a violation
  2895. 1:58:02in here because
  2896. 1:58:05I was saying that after this rising edge
  2897. 1:58:07of this clock,
  2898. 1:58:10it's a new data shouldn't come.
  2899. 1:58:15Bet- between rising edge and after 70
  2900. 1:58:18picosecond. During this interval, a new
  2901. 1:58:20data shouldn't come. But it came at 55
  2902. 1:58:23picoseconds. After 55 picosecond, it
  2903. 1:58:26came. This is a violation. This is a uh
  2904. 1:58:29this is a violation of the this for this
  2905. 1:58:32flip flop. It violates the whole time
  2906. 1:58:34constraint of this flip flop.
  2907. 1:58:35So, in this case,
  2908. 1:58:39what should I do?
  2909. 1:58:40I have to do this path a little bit
  2910. 1:58:42slower because this path is very fast
  2911. 1:58:45and due to this is very this is fast,
  2912. 1:58:48while this flip flop is sampling the old
  2913. 1:58:50data, the made, data arrives
  2914. 1:58:52immediately. So, I need to make this
  2915. 1:58:54that a little bit slower. So, how can I
  2916. 1:58:57do it? I can add a buffer in here. So,
  2917. 1:58:59if I have add a buffer, for example,
  2918. 1:59:01just buffer,
  2919. 1:59:02I am adding another 30 picosecond, not
  2920. 1:59:05not 30 picosecond, 35 picosecond because
  2921. 1:59:08gate delay was 35 picosecond. I added
  2922. 1:59:10another 35 picosecond. So, when I add
  2923. 1:59:13another 55 + 35,
  2924. 1:59:16then
  2925. 1:59:17it is fine. It is the 90 picosecond, so
  2926. 1:59:20it
  2927. 1:59:21it complies with the hold time
  2928. 1:59:22constraint.
  2929. 1:59:24Uh
  2930. 1:59:24Could you understand this point?
  2931. 1:59:27Hold time?
  2932. 1:59:31No?
  2933. 1:59:36So, hold time actually is related, yeah,
  2934. 1:59:39to
  2935. 1:59:41this flip-flop
  2936. 1:59:43while clock when clock comes,
  2937. 1:59:45we said that
  2938. 1:59:47data must be ready
  2939. 1:59:50during this T setup time.
  2940. 1:59:53And it must be stable after rising edge
  2941. 1:59:57during this T hold time.
  2942. 2:00:00But, what if, for example, for this
  2943. 2:00:02flip-flop,
  2944. 2:00:04when the clock comes, clock rises,
  2945. 2:00:08while this flip-flop samples the data at
  2946. 2:00:11this point,
  2947. 2:00:12this flip-flop sends new data.
  2948. 2:00:17In this case, this flip-flop cannot
  2949. 2:00:19sample
  2950. 2:00:20in a healthy way
  2951. 2:00:22because it violates this whole time
  2952. 2:00:25period. While we are sampling the old
  2953. 2:00:27data, new data comes. And in this case,
  2954. 2:00:30we don't know. We sampled maybe old data
  2955. 2:00:32or new data. We don't know. This is a
  2956. 2:00:34violation for this flip-flop.
  2957. 2:00:37So,
  2958. 2:00:38and in here, according to our
  2959. 2:00:40computation, we had a hold time
  2960. 2:00:42violation because this path was
  2961. 2:00:44providing the data very fastly
  2962. 2:00:47before this flip-flop samples to old
  2963. 2:00:50data.
  2964. 2:00:51So, in this case, it
  2965. 2:00:54this
  2966. 2:00:55circuit will not reliably
  2967. 2:00:58run.
  2968. 2:00:59Uh and in order to solve it,
  2969. 2:01:01we told that we need to make this path
  2970. 2:01:04slower.
  2971. 2:01:06So, to make this path slower, we just
  2972. 2:01:09added a buffer in here. So, when we add
  2973. 2:01:12a buffer in here,
  2974. 2:01:14we it is like adding a
  2975. 2:01:17extra 35 picosecond. We are making
  2976. 2:01:20this path a little bit slower, so that
  2977. 2:01:22while this flip-flop samples to old
  2978. 2:01:24data, new data cannot arrive.
  2979. 2:01:28So, this buffer makes this path a little
  2980. 2:01:29bit slower.
  2981. 2:01:32And in this case, hold time constraint
  2982. 2:01:34is also complied. No problem in hold
  2983. 2:01:37time constraint.
  2984. 2:01:39I think setup is mostly most time setup
  2985. 2:01:41is clear, but hold time is people are
  2986. 2:01:43more confused about it.
  2987. 2:01:46Uh unfortunately, in people I think
  2988. 2:01:49they should be uh
  2989. 2:01:51they should be they should teach them
  2990. 2:01:53during the digital logic course.
  2991. 2:01:56Uh because this is very fundamental
  2992. 2:01:57concept, but unfortunately, they are not
  2993. 2:01:59teaching well. Uh
  2994. 2:02:02But maybe if you don't understand still,
  2995. 2:02:04we can do it one more time later.
  2996. 2:02:07But
  2997. 2:02:08I think we need to finish the class.
  2998. 2:02:12And uh for the power also, I mentioned
  2999. 2:02:14about the timing in here, and also
  3000. 2:02:16another concept related to digital
  3001. 2:02:18circuits power. Uh power is the energy
  3002. 2:02:20consumed per unit time. There are two
  3003. 2:02:22types of power, dynamic power and static
  3004. 2:02:24power. And you can see the formulas
  3005. 2:02:27uh about the power.
  3006. 2:02:29Uh since we are changing the circuit one
  3007. 2:02:30and zeros, of course, we are charging a
  3008. 2:02:33capacitor and discharging a capacitor.
  3009. 2:02:35Of course, it consumes some power.
  3010. 2:02:37And these are the
  3011. 2:02:39formula formulas to con- compute power.
  3012. 2:02:43Uh, dynamic power is related to changing
  3013. 2:02:46because we are charging and discharging
  3014. 2:02:48capacitors and static power is the
  3015. 2:02:50leakage power, like leakage power. If
  3016. 2:02:52you apply a
  3017. 2:02:53in a transistor,
  3018. 2:02:55even you don't change the this input, I
  3019. 2:02:59assume that this input one,
  3020. 2:03:01uh, it doesn't maybe
  3021. 2:03:03assume that this is a PMOS, okay? It
  3022. 2:03:05doesn't conduct. Still there is a small
  3023. 2:03:07leakage.
  3024. 2:03:09And this small leakage causes the static
  3025. 2:03:11power consumption. Even there is no
  3026. 2:03:13gates are switching, it it consumes some
  3027. 2:03:15power. Dynamic power is switching. For
  3028. 2:03:18example, you change it, you have an
  3029. 2:03:20inverter, for example, you apply 1010 in
  3030. 2:03:24order, it is changing 0101. So, you are
  3031. 2:03:27switching always, so it consumes power.
  3032. 2:03:30This is the static power consumption.
  3033. 2:03:33So, these are the concepts you need to
  3034. 2:03:34know. Uh, so
  3035. 2:03:37as the last slide, uh, the the course
  3036. 2:03:39assumes a fair knowledge about digital
  3037. 2:03:41circuits. Uh, not much timing or power.
  3038. 2:03:44Uh,
  3039. 2:03:45for example, if you don't know hold hold
  3040. 2:03:47time, it is fine. Uh, but you need to
  3041. 2:03:50know at least what these gates are and
  3042. 2:03:53what is finite state machines, what
  3043. 2:03:55sequential gates are, what is flip flop,
  3044. 2:03:57what is latch. You need to know them.
  3045. 2:04:00Uh, for timing, I know they are not
  3046. 2:04:01teaching well. Uh, for this reason it is
  3047. 2:04:04acceptable. Uh,
  3048. 2:04:06but if you don't know,
  3049. 2:04:08for example, gates or finite state
  3050. 2:04:10machines, this course is not for you.
  3051. 2:04:12So, you need to pay attention to this
  3052. 2:04:14point.
  3053. 2:04:15Uh, so if you are not much familiar
  3054. 2:04:17about these concepts, uh, either you can
  3055. 2:04:19refresh, for example, maybe you you have
  3056. 2:04:21forgotten, no problem, you can refresh
  3057. 2:04:24your knowledge.
  3058. 2:04:25Uh,
  3059. 2:04:27or you can work more to learn the basic
  3060. 2:04:29concepts. Uh, but we are as I told you,
  3061. 2:04:31we are not for we we are not going to
  3062. 2:04:33focus on digital circuits, analog
  3063. 2:04:35circuits, devices, or physics. I will
  3064. 2:04:37not show any NMOS transistors. By using
  3065. 2:04:39this fundamental knowledge, we are going
  3066. 2:04:41to build more complex processors. For
  3067. 2:04:43this reason, the concepts that I show
  3068. 2:04:45you is very important. You need to know
  3069. 2:04:47them. You have to know them in order to
  3070. 2:04:48take this class.
  3071. 2:04:50So,
  3072. 2:04:51and this is the
  3073. 2:04:53week for the add-drop, so you can review
  3074. 2:04:56your your selection in the class.
  3075. 2:04:59Uh so, we can flash finish the core
  3076. 2:05:01class in here.
  3077. 2:05:03Uh if you have a question, you can ask.
  3078. 2:05:06And also, if you want to review some
  3079. 2:05:09concepts
  3080. 2:05:10concepts, you can write me. Maybe we can
  3081. 2:05:13do an office hours, most likely online
  3082. 2:05:15office hours. Uh generally, I am
  3083. 2:05:17spending my
  3084. 2:05:19one one day in a week in here.
  3085. 2:05:21In Wednesday, I'm in here, but I don't
  3086. 2:05:24have room yet. Uh you can come in
  3087. 2:05:26person, or maybe you can write an email
  3088. 2:05:28to me, and I can show you. And also, I
  3089. 2:05:30have TAs actually in this class. Uh so,
  3090. 2:05:33they can also help to you. Uh any
  3091. 2:05:35questions?
  3092. 2:05:36If no questions, we can we can finish
  3093. 2:05:38the class.
  3094. 2:05:40Okay?
  3095. 2:05:42Then, see you next week, inshallah.

About this transcript

This page contains the full transcript of W1 Introduction EN by Hasan Erdem Yantır, generated from the public captions YouTube serves with the video. The transcript has 17,664 words across 3,095 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.