SlideShare a Scribd company logo
1 of 19
Download to read offline
Logic &
Combinational Logic
LAB: Logic Operation
 test_counter
                 dut
                       counter
  Stimulus and
  control
                                 count[7:0]
                       clk
                       reset
                       enable
                                 counter
                                                              Response
                               logic_block
                                                    logic_out monitor
                       A
                                                             verification
                       B
                                      logic_block
                       C
                       C   B     A   logic_out
                       0   0     0   1
  assign               0   0     1   1
  !: NOT               0   1     0   1
                       0   1     1   1
  &&: AND              1   0     0   0
  ||: OR               1   0     1   0
                       1   1     0   0
                       1   1     1   1
Decoder




          I1   I0   Y0   Y1   Y2   Y3
          0    0    1    0    0    0
          0    1    0    1    0    0
          1    0    0    0    1    0
          1    1    0    0    0    1
7 segment decoder




          Binary   a   b   c   d   e   f   g   dp
          0000     0   0   0   0   0   0   1   1
          0001     1   0   0   1   1   1   1   1
          ......
MAX II         7 segment
         實驗板


                    當Common pin 為高準位時,表示啟動其中
                  ●


                  一組七段顯示器
                    當Segment pin 為低準位時,表示點亮那一
                  ●


                  段LED
Verilog Code

case (in)
  4'h0: seg_out = 8'b1100_0000;     // 0 active low '0'
  4'h1: seg_out = 8'b1111_1001;     // 1
  4'h2: seg_out = 8'b1010_0100;     // 2
  4'h3:
 4'h4:
  ...............................
 4'hf:
  default:
 end case;
LAB: Decoder
 test_counter
                   dut
                             counter
  Stimulus and
  control
                                         count[7:0]
                             clk
                             reset
                             enable
                                        counter
                                                                   Response
  use                                  led_dec
                                                                    monitor
                                                            seg0
  procedure
                                                                   verification
  timing control
                                                  led_dec
                         a = seg(0);
                                                            seg1
                         b = seg(1);
                         c = seg(2);
                         d = seg(3);
                         e = seg(4);
                         f = seg(5);
                         g = seg(6);
                         dp = seg(7)
Encoder




I0 I1 I2 I3 I4 I5 I6 I7   Y2   Y1   Y0   IDLE
00000000                  x    x    x    1
10000000                  0    0    0    0
01000000                  0    0    1    0
                                                IDLE = (!I0) * (!I1)....(!I7) = !(I0+I1+...I7)
00100000                  0    1    0    0
00010000                  0    1    1    0
                                                Y0 = I1 + I3 + I5 + I7
00001000                  1    0    0    0
                                                Y1 = I2 + I3 + I6 + I7
00000100                  1    0    1    0
                                                Y2 = I4 + I5 + I6 + I7
................
Priotity Encoder

                   I7 = R7
                   I6 = R6 * (!R7)
                   I5 = R5 * (!R6) * (!R7)
                   ......
                   I0 = R0 * (!R1).....(!R7)




                   Y0 = I1 + I3 + I5 + I7
                   Y1 = I2 + I3 + I6 + I7
                   Y2 = I4 + I5 + I6 + I7
Multiplexer, De-Mux
Comparator




             AGTBOUT = (A>B) + (A=B) * AGTBIN
             AEQBOUT = (A=B) * AEQBIN
             ALTBOUT = (A<B) +(A=B) * ALTBIN
LAB: Mux
 test_counter
                   dut

                         counter
  Stimulus and
  control
                                count[7:0]
                         clk
                         reset
                         enable
                                counter
                                                  seg0    Response
  use                           led_dec           seg1     monitor
  procedure
                                                          verification
  timing control


                                sel_data
                         seg0
                                           1
                         seg1                            led_seg[7:0]
                                           0
                                       sel_data
LAB: Encoder, Priority Encoder,
Comparator
 test_counter
                      dut
                                                              cntgt64
                                counter
  Stimulus and
  control
                                       count[7:0]
                                clk
                                reset
                                enable
                                       counter
                                                     seg0
  use                                  led_dec       seg1    Response
  procedure
                                                              monitor
  timing control
                                                             verification
                                seg0
                                                 1          led_seg[7:0]
                                seg1             0
                   event[7:0]
                                            IDLE
                            Event encoder
                                            Y[2:0]
Parity Check
Adder

    Half Adder
●
    S=X^Y
    COUT = X*Y



    Full Adder
●
    S = X ^ Y ^ CIN
    CO = X*Y + X*CIN + Y*CIN
Subtractor


A3 B3   A2 B2   A1 B1   A0 B0




                                1
ALU

                                                aluo[4:0]
   A[3:0]
   B[3:0]
                              ALU
   S[1:0]




S[1:0]      A[3:0]   B[3:0]    aluo[4]   aluo[3:0]
                               進位
00          A        B                   A+B
                               借位
01          A        B                   A-B
10          A        B         0         A AND B
11          A        B         0         A OR B
LAB: new project, ALU
 lab2
                    dut

  Stimulus and
  control


                                aluo[4:0]
                 S[1:0]
                 A[3:0]   ALU
                 B[3:0]
                                            Response
                                             monitor
                                            verification
Appendix
ALU
module alu ( A, B, sel, aluo);
input [3:0] A, B;
input [1:0] sel;
output [4:0] aluo;
reg [4:0] aluo;
always @(A or B or sel)
  begin
     if (sel == 0)               // how about case
          aluo = A+B;
     else if (sel == 1)
          aluo = A-B;
     else if (sel == 2)
          aluo = A & B;
     else
          aluo = A | B;
  end
endmodule

More Related Content

What's hot

Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical FileSoumya Behera
 
Indirect Communications (Concurrency)
Indirect Communications (Concurrency)Indirect Communications (Concurrency)
Indirect Communications (Concurrency)Sri Prasanna
 
Ee2 chapter13 counters
Ee2 chapter13 countersEe2 chapter13 counters
Ee2 chapter13 countersCK Yang
 
radix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdfradix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdfsakthi1986
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECERamesh Naik Bhukya
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manualSanthosh Poralu
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building HierarchyMohamed Samy
 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESkarthik kadava
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programsGouthaman V
 
Create your first model for a simple logic circuit
Create your first model for a simple logic circuitCreate your first model for a simple logic circuit
Create your first model for a simple logic circuitMohamed Samy
 
Embedded system design psoc lab report
Embedded system design psoc lab reportEmbedded system design psoc lab report
Embedded system design psoc lab reportRamesh Naik Bhukya
 

What's hot (20)

Fpga creating counter with external clock
Fpga   creating counter with external clockFpga   creating counter with external clock
Fpga creating counter with external clock
 
Programs of VHDL
Programs of VHDLPrograms of VHDL
Programs of VHDL
 
DHow2 - L6 VHDL
DHow2 - L6 VHDLDHow2 - L6 VHDL
DHow2 - L6 VHDL
 
Dsd lab Practical File
Dsd lab Practical FileDsd lab Practical File
Dsd lab Practical File
 
Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31Arduino Workshop 2011.05.31
Arduino Workshop 2011.05.31
 
Indirect Communications (Concurrency)
Indirect Communications (Concurrency)Indirect Communications (Concurrency)
Indirect Communications (Concurrency)
 
Ee2 chapter13 counters
Ee2 chapter13 countersEe2 chapter13 counters
Ee2 chapter13 counters
 
radix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdfradix_4 fft dif with mdc and mdf
radix_4 fft dif with mdc and mdf
 
FPGA Tutorial - LCD Interface
FPGA Tutorial - LCD InterfaceFPGA Tutorial - LCD Interface
FPGA Tutorial - LCD Interface
 
Digital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECEDigital System Design Lab Report - VHDL ECE
Digital System Design Lab Report - VHDL ECE
 
Digital system design lab manual
Digital system design lab manualDigital system design lab manual
Digital system design lab manual
 
Fpga creating counter with internal clock
Fpga   creating counter with internal clockFpga   creating counter with internal clock
Fpga creating counter with internal clock
 
Building Hierarchy
Building HierarchyBuilding Hierarchy
Building Hierarchy
 
VHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLESVHDL PROGRAMS FEW EXAMPLES
VHDL PROGRAMS FEW EXAMPLES
 
All VLSI programs
All VLSI programsAll VLSI programs
All VLSI programs
 
Direct analog
Direct analogDirect analog
Direct analog
 
Create your first model for a simple logic circuit
Create your first model for a simple logic circuitCreate your first model for a simple logic circuit
Create your first model for a simple logic circuit
 
Embedded system design psoc lab report
Embedded system design psoc lab reportEmbedded system design psoc lab report
Embedded system design psoc lab report
 
Behavioral modelling in VHDL
Behavioral modelling in VHDLBehavioral modelling in VHDL
Behavioral modelling in VHDL
 
Programming arduino makeymakey
Programming arduino makeymakeyProgramming arduino makeymakey
Programming arduino makeymakey
 

Similar to Day2.Combinational Logic

Day4 Lab
Day4 LabDay4 Lab
Day4 LabRon Liu
 
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLSeminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLNaseer LoneRider
 
Verilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdfVerilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdfAzeemMohammedAbdul
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL BasicRon Liu
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기Ji Hun Kim
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUSachin Kumar Asokan
 
Digital logic circuit
Digital logic circuit Digital logic circuit
Digital logic circuit Prabhu R
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportAkash Mhankale
 
lecture8_Cuong.ppt
lecture8_Cuong.pptlecture8_Cuong.ppt
lecture8_Cuong.pptHongV34104
 
Laboratory exercise 5
Laboratory exercise 5Laboratory exercise 5
Laboratory exercise 5swapnilswap11
 
Project single cyclemips processor_verilog
Project single cyclemips processor_verilogProject single cyclemips processor_verilog
Project single cyclemips processor_verilogHarsha Yelisala
 

Similar to Day2.Combinational Logic (20)

Day4 Lab
Day4 LabDay4 Lab
Day4 Lab
 
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDLSeminar on Digital Multiplier(Booth Multiplier) Using VHDL
Seminar on Digital Multiplier(Booth Multiplier) Using VHDL
 
Verilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdfVerilog for synthesis - combinational rev a.pdf
Verilog for synthesis - combinational rev a.pdf
 
Day2 Verilog HDL Basic
Day2 Verilog HDL BasicDay2 Verilog HDL Basic
Day2 Verilog HDL Basic
 
Windbg랑 친해지기
Windbg랑 친해지기Windbg랑 친해지기
Windbg랑 친해지기
 
VLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALUVLSI Design Final Project - 32 bit ALU
VLSI Design Final Project - 32 bit ALU
 
Unit 4 dica
Unit 4 dicaUnit 4 dica
Unit 4 dica
 
Digital logic circuit
Digital logic circuit Digital logic circuit
Digital logic circuit
 
vhdll.docx
vhdll.docxvhdll.docx
vhdll.docx
 
verilog_1.ppt
verilog_1.pptverilog_1.ppt
verilog_1.ppt
 
Digital Alarm Clock 446 project report
Digital Alarm Clock 446 project reportDigital Alarm Clock 446 project report
Digital Alarm Clock 446 project report
 
lecture8_Cuong.ppt
lecture8_Cuong.pptlecture8_Cuong.ppt
lecture8_Cuong.ppt
 
Uart
UartUart
Uart
 
Laboratory exercise 5
Laboratory exercise 5Laboratory exercise 5
Laboratory exercise 5
 
Operating System
Operating SystemOperating System
Operating System
 
Tdm to vo ip 2
Tdm to vo ip 2Tdm to vo ip 2
Tdm to vo ip 2
 
Reporte vhdl9
Reporte vhdl9Reporte vhdl9
Reporte vhdl9
 
Presentation i-m
Presentation i-mPresentation i-m
Presentation i-m
 
Project single cyclemips processor_verilog
Project single cyclemips processor_verilogProject single cyclemips processor_verilog
Project single cyclemips processor_verilog
 
chapter 4
chapter 4chapter 4
chapter 4
 

More from Ron Liu

Engineer
EngineerEngineer
EngineerRon Liu
 
Start up nations
Start up nationsStart up nations
Start up nationsRon Liu
 
XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07Ron Liu
 
book digest: product design and development
book digest: product design and developmentbook digest: product design and development
book digest: product design and developmentRon Liu
 
The Hero Within
The Hero WithinThe Hero Within
The Hero WithinRon Liu
 
About Thinking
About ThinkingAbout Thinking
About ThinkingRon Liu
 
書摘Teach Your Child How To Think
書摘Teach Your Child How To Think書摘Teach Your Child How To Think
書摘Teach Your Child How To ThinkRon Liu
 
Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現Ron Liu
 
Day4 Open
Day4 OpenDay4 Open
Day4 OpenRon Liu
 
Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Ron Liu
 
Day3 Lab
Day3 LabDay3 Lab
Day3 LabRon Liu
 
Day3 Quartus II Tutorial
Day3 Quartus II TutorialDay3 Quartus II Tutorial
Day3 Quartus II TutorialRon Liu
 
Day3 實驗板介紹
Day3 實驗板介紹Day3 實驗板介紹
Day3 實驗板介紹Ron Liu
 
Day2 Intro. Model Sim
Day2 Intro. Model SimDay2 Intro. Model Sim
Day2 Intro. Model SimRon Liu
 
Day2 Logic Circuits
Day2 Logic CircuitsDay2 Logic Circuits
Day2 Logic CircuitsRon Liu
 
Day2 Open
Day2 OpenDay2 Open
Day2 OpenRon Liu
 
Day1 Lab1
Day1 Lab1Day1 Lab1
Day1 Lab1Ron Liu
 
Day1 02.Introduction
Day1 02.IntroductionDay1 02.Introduction
Day1 02.IntroductionRon Liu
 
Day1 CourseIntroduction
Day1 CourseIntroductionDay1 CourseIntroduction
Day1 CourseIntroductionRon Liu
 
Free Lunch Talk Ron Nov 08
Free Lunch Talk Ron Nov 08Free Lunch Talk Ron Nov 08
Free Lunch Talk Ron Nov 08Ron Liu
 

More from Ron Liu (20)

Engineer
EngineerEngineer
Engineer
 
Start up nations
Start up nationsStart up nations
Start up nations
 
XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07XXX-Company-my viewpoints-2011-03-07
XXX-Company-my viewpoints-2011-03-07
 
book digest: product design and development
book digest: product design and developmentbook digest: product design and development
book digest: product design and development
 
The Hero Within
The Hero WithinThe Hero Within
The Hero Within
 
About Thinking
About ThinkingAbout Thinking
About Thinking
 
書摘Teach Your Child How To Think
書摘Teach Your Child How To Think書摘Teach Your Child How To Think
書摘Teach Your Child How To Think
 
Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現Day3 順序控制的組合邏輯實現
Day3 順序控制的組合邏輯實現
 
Day4 Open
Day4 OpenDay4 Open
Day4 Open
 
Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現Day4 順序控制的循序邏輯實現
Day4 順序控制的循序邏輯實現
 
Day3 Lab
Day3 LabDay3 Lab
Day3 Lab
 
Day3 Quartus II Tutorial
Day3 Quartus II TutorialDay3 Quartus II Tutorial
Day3 Quartus II Tutorial
 
Day3 實驗板介紹
Day3 實驗板介紹Day3 實驗板介紹
Day3 實驗板介紹
 
Day2 Intro. Model Sim
Day2 Intro. Model SimDay2 Intro. Model Sim
Day2 Intro. Model Sim
 
Day2 Logic Circuits
Day2 Logic CircuitsDay2 Logic Circuits
Day2 Logic Circuits
 
Day2 Open
Day2 OpenDay2 Open
Day2 Open
 
Day1 Lab1
Day1 Lab1Day1 Lab1
Day1 Lab1
 
Day1 02.Introduction
Day1 02.IntroductionDay1 02.Introduction
Day1 02.Introduction
 
Day1 CourseIntroduction
Day1 CourseIntroductionDay1 CourseIntroduction
Day1 CourseIntroduction
 
Free Lunch Talk Ron Nov 08
Free Lunch Talk Ron Nov 08Free Lunch Talk Ron Nov 08
Free Lunch Talk Ron Nov 08
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Day2.Combinational Logic

  • 2. LAB: Logic Operation test_counter dut counter Stimulus and control count[7:0] clk reset enable counter Response logic_block logic_out monitor A verification B logic_block C C B A logic_out 0 0 0 1 assign 0 0 1 1 !: NOT 0 1 0 1 0 1 1 1 &&: AND 1 0 0 0 ||: OR 1 0 1 0 1 1 0 0 1 1 1 1
  • 3. Decoder I1 I0 Y0 Y1 Y2 Y3 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 0 1 1 0 0 0 1
  • 4. 7 segment decoder Binary a b c d e f g dp 0000 0 0 0 0 0 0 1 1 0001 1 0 0 1 1 1 1 1 ......
  • 5. MAX II 7 segment 實驗板 當Common pin 為高準位時,表示啟動其中 ● 一組七段顯示器 當Segment pin 為低準位時,表示點亮那一 ● 段LED
  • 6. Verilog Code case (in) 4'h0: seg_out = 8'b1100_0000; // 0 active low '0' 4'h1: seg_out = 8'b1111_1001; // 1 4'h2: seg_out = 8'b1010_0100; // 2 4'h3: 4'h4: ............................... 4'hf: default: end case;
  • 7. LAB: Decoder test_counter dut counter Stimulus and control count[7:0] clk reset enable counter Response use led_dec monitor seg0 procedure verification timing control led_dec a = seg(0); seg1 b = seg(1); c = seg(2); d = seg(3); e = seg(4); f = seg(5); g = seg(6); dp = seg(7)
  • 8. Encoder I0 I1 I2 I3 I4 I5 I6 I7 Y2 Y1 Y0 IDLE 00000000 x x x 1 10000000 0 0 0 0 01000000 0 0 1 0 IDLE = (!I0) * (!I1)....(!I7) = !(I0+I1+...I7) 00100000 0 1 0 0 00010000 0 1 1 0 Y0 = I1 + I3 + I5 + I7 00001000 1 0 0 0 Y1 = I2 + I3 + I6 + I7 00000100 1 0 1 0 Y2 = I4 + I5 + I6 + I7 ................
  • 9. Priotity Encoder I7 = R7 I6 = R6 * (!R7) I5 = R5 * (!R6) * (!R7) ...... I0 = R0 * (!R1).....(!R7) Y0 = I1 + I3 + I5 + I7 Y1 = I2 + I3 + I6 + I7 Y2 = I4 + I5 + I6 + I7
  • 11. Comparator AGTBOUT = (A>B) + (A=B) * AGTBIN AEQBOUT = (A=B) * AEQBIN ALTBOUT = (A<B) +(A=B) * ALTBIN
  • 12. LAB: Mux test_counter dut counter Stimulus and control count[7:0] clk reset enable counter seg0 Response use led_dec seg1 monitor procedure verification timing control sel_data seg0 1 seg1 led_seg[7:0] 0 sel_data
  • 13. LAB: Encoder, Priority Encoder, Comparator test_counter dut cntgt64 counter Stimulus and control count[7:0] clk reset enable counter seg0 use led_dec seg1 Response procedure monitor timing control verification seg0 1 led_seg[7:0] seg1 0 event[7:0] IDLE Event encoder Y[2:0]
  • 15. Adder Half Adder ● S=X^Y COUT = X*Y Full Adder ● S = X ^ Y ^ CIN CO = X*Y + X*CIN + Y*CIN
  • 16. Subtractor A3 B3 A2 B2 A1 B1 A0 B0 1
  • 17. ALU aluo[4:0] A[3:0] B[3:0] ALU S[1:0] S[1:0] A[3:0] B[3:0] aluo[4] aluo[3:0] 進位 00 A B A+B 借位 01 A B A-B 10 A B 0 A AND B 11 A B 0 A OR B
  • 18. LAB: new project, ALU lab2 dut Stimulus and control aluo[4:0] S[1:0] A[3:0] ALU B[3:0] Response monitor verification
  • 19. Appendix ALU module alu ( A, B, sel, aluo); input [3:0] A, B; input [1:0] sel; output [4:0] aluo; reg [4:0] aluo; always @(A or B or sel) begin if (sel == 0) // how about case aluo = A+B; else if (sel == 1) aluo = A-B; else if (sel == 2) aluo = A & B; else aluo = A | B; end endmodule