SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 

Kürzlich hochgeladen (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 

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