SlideShare une entreprise Scribd logo
1  sur  10
ENGR. RASHID FARID CHISHTI
LECTURER,DEE, FET, IIUI
CHISHTI@IIU.EDU.PK
WEEK 10
BCD TO EXCESS 3 CONVERTER
MANCHESTER ENCODING
FPGA Based System Design
Sunday, May 17, 2015
1
www.iiu.edu.pk
 A serially-transmitted BCD (8421 code)
word is to be converted into an Excess-
3 code
 An Excess-3 code word is obtained by
adding 3 to the decimal value and
taking the binary equivalent.
 Excess-3 code is self-complementing
!(0011) = 1100 again an excess-3 code
!(0100) = 1011
www.iiu.edu.pk Sunday, May 17, 2015
BCD to Excess-3 Code Converter
2
Decimal
Digit
8-4-2-1
Code
(BCD)
Excess-3
Code
0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100
www.iiu.edu.pk Sunday, May 17, 2015
Serial BCD to Excess-3 Code Converter
3
www.iiu.edu.pk Sunday, May 17, 2015
Mealy Model State Machine
4
Decimal
Digit
BCD
Code
Excess-3
Code
0 0000 0011
1 0001 0100
2 0010 0101
3 0011 0110
4 0100 0111
5 0101 1000
6 0110 1001
7 0111 1010
8 1000 1011
9 1001 1100
S0S0
S1S1
S2S2
S3S3
0/1
0/1
0/0
0/0
S4S4
1/0
S5S5
0/0
0/1
1/0
S6S6
1/1
1/1 1/0
1/1
0/1
reset
module BCD_to_Excess_3 (y, x, pstate, clk, reset);
output y, pstate; input x, clk, reset;
parameter S0 = 3'd0, S1 = 3'd1, S2 = 3'd2, S3 = 3'd3, S4 = 3'd4, S5 = 3'd5, S6 = 3'd6;
reg[2: 0] pstate, nxtstate; reg y;
always @ (posedge clk or negedge reset)
if (reset== 0) pstate <= S0; else pstate <= nxtstate;
always @ (pstate or x) begin
case (pstate)
S0: if (x) begin nxtstate = S4; y = 0; end
else begin nxtstate = S1; y = 1; end
S1: if (x) begin nxtstate = S5; y = 0; end
else begin nxtstate = S2; y = 1; end
S2: begin nxtstate = S3; y = x; end
S3: begin nxtstate = S0; y = x; end
S4: begin nxtstate = S5; y = x; end
S5: if (x) begin nxtstate = S6; y = 0; end
else begin nxtstate = S3; y = 1; end
S6: begin nxtstate = S0; y = 1; end
default: begin nxtstate = 3'dx; y = 1'bx; end
endcase end endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Behavioral Modeling
5
module Test_BCD_to_Excess3;
wire y; wire [2:0]pstate; reg x, clk, reset;
BCD_to_Excess_3 BE1 (y, x, pstate, clk, reset);
initial begin reset = 1;
#7 reset = 0; #3 reset = 1;
end
initial begin clk = 0;
repeat (20) #5 clk = ~clk;
end
initial begin x = 1;
repeat (10) #10 x = ~ x;
end
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Test Bench
6
S0S0
S1S1
S2S2
S3S3
0/1
0/1
0/0
0/0
S4S4
1/0
S5S5
0/0
0/1
1/0
S6S6
1/1
1/1 1/0
1/1
0/1
reset
 Each bit is transmitted in a fixed time (the "period").
 A 0 is expressed by a low-to-high transition, a 1 by high-to-low transition.
 The transitions which signify 0 or 1 occur at the midpoint of a period.
 Transitions at the start of a period are overhead and don't signify data.
 Manchester coding is widely used in Ethernet, RFID and Near Field Communication.
www.iiu.edu.pk Sunday, May 17, 2015
Manchester Encoding
7
S1S1 S2S2
0/01/1
0/11/0
S0S0
module NRZ_2_Manchester_Mealy (B_out, state, B_in, clock, reset_b);
output B_out; input B_in; input clock, reset_b; output state;
reg [1: 0] state, next_state; reg B_out;
parameter S0 = 0, S1 = 1, S2 = 2, dont_care_state = 2'bx, dont_care_out = 1'bx;
always @ (negedge clock or negedge reset_b)
if (reset_b == 0) state <= S0;
else state <= next_state;
always @ (state or B_in ) begin
B_out = 0;
case (state)
S0: if (B_in == 0) begin next_state = S2; B_out = 0; end
else if (B_in == 1) begin next_state = S1; B_out = 1; end
S1: begin next_state = S0; B_out = 0; end
S2: begin next_state = S0; B_out = 1; end
default: begin next_state = dont_care_state;
B_out = dont_care_out; end
endcase
end
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Manchester Encoding
8
S1S1 S2S2
0/01/1
0/11/0
S0S0
module test_NRZ_2_Manchester_Mealy;
wire B_out; reg B_in, clk, rst; wire [1:0] state; reg clk2;
NRZ_2_Manchester_Mealy (B_out, state, B_in, clk, rst);
initial begin rst = 1; #7 rst = 0; #3 rst = 1; end
initial begin clk = 0;
repeat (20) #5 clk = ~clk; end
initial begin clk2 = 1;
repeat (10) #10 clk2 = ~clk2; end
initial begin B_in = 1;
repeat (3) #40 B_in = ~ B_in; end
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Manchester Encoding Test Bench
9
S1S1 S2S2
0/01/1
0/11/0
S0S0
module test_NRZ_2_Manchester_Mealy;
wire B_out; reg B_in, clk, rst; wire [1:0] state; reg clk2;
NRZ_2_Manchester_Mealy (B_out, state, B_in, clk, rst);
initial begin rst = 1; #7 rst = 0; #3 rst = 1; end
initial begin clk = 0;
repeat (20) #5 clk = ~clk; end
initial begin clk2 = 1;
repeat (10) #10 clk2 = ~clk2; end
initial begin B_in = 1;
repeat (3) #40 B_in = ~ B_in; end
endmodule
www.iiu.edu.pk Sunday, May 17, 2015
Manchester Encoding Test Bench
9
S1S1 S2S2
0/01/1
0/11/0
S0S0

Contenu connexe

Tendances

System verilog important
System verilog importantSystem verilog important
System verilog importantelumalai7
 
Lecture 10 data structures and algorithms
Lecture 10 data structures and algorithmsLecture 10 data structures and algorithms
Lecture 10 data structures and algorithmsAakash deep Singhal
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorAshita Agrawal
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flowPushpa Yakkala
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學 艾鍗科技
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructionsRavi Anand
 
Weight enumerators of block codes and the mc williams
Weight  enumerators of block codes and  the mc williamsWeight  enumerators of block codes and  the mc williams
Weight enumerators of block codes and the mc williamsMadhumita Tamhane
 
Selection Sort - Vipin Ramola
Selection Sort - Vipin RamolaSelection Sort - Vipin Ramola
Selection Sort - Vipin RamolaDipayan Sarkar
 
Lect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute BeginnersLect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute BeginnersDr.YNM
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLE2MATRIX
 
Tree terminology and introduction to binary tree
Tree terminology and introduction to binary treeTree terminology and introduction to binary tree
Tree terminology and introduction to binary treejyoti_lakhani
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test BenchDr.YNM
 

Tendances (20)

System verilog important
System verilog importantSystem verilog important
System verilog important
 
Lecture 10 data structures and algorithms
Lecture 10 data structures and algorithmsLecture 10 data structures and algorithms
Lecture 10 data structures and algorithms
 
Instruction Set of 8086 Microprocessor
Instruction Set of 8086 MicroprocessorInstruction Set of 8086 Microprocessor
Instruction Set of 8086 Microprocessor
 
KMAP
KMAPKMAP
KMAP
 
8086 addressing modes
8086 addressing modes8086 addressing modes
8086 addressing modes
 
Decimal adder
Decimal adderDecimal adder
Decimal adder
 
System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flow
 
Clinica
ClinicaClinica
Clinica
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學
 
Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
 
Weight enumerators of block codes and the mc williams
Weight  enumerators of block codes and  the mc williamsWeight  enumerators of block codes and  the mc williams
Weight enumerators of block codes and the mc williams
 
Selection Sort - Vipin Ramola
Selection Sort - Vipin RamolaSelection Sort - Vipin Ramola
Selection Sort - Vipin Ramola
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
 
8051 MICROCONTROLLER
8051 MICROCONTROLLER 8051 MICROCONTROLLER
8051 MICROCONTROLLER
 
Lect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute BeginnersLect 7: Verilog Behavioral model for Absolute Beginners
Lect 7: Verilog Behavioral model for Absolute Beginners
 
Latches and flip flops
Latches and flip flopsLatches and flip flops
Latches and flip flops
 
stack
stackstack
stack
 
System Verilog Tutorial - VHDL
System Verilog Tutorial - VHDLSystem Verilog Tutorial - VHDL
System Verilog Tutorial - VHDL
 
Tree terminology and introduction to binary tree
Tree terminology and introduction to binary treeTree terminology and introduction to binary tree
Tree terminology and introduction to binary tree
 
Verilog Test Bench
Verilog Test BenchVerilog Test Bench
Verilog Test Bench
 

En vedette (13)

Manchester Encoding
Manchester EncodingManchester Encoding
Manchester Encoding
 
Bcd to excess 3 code converter
Bcd to excess 3 code converterBcd to excess 3 code converter
Bcd to excess 3 code converter
 
The BCD to excess-3 converter
The BCD to excess-3 converterThe BCD to excess-3 converter
The BCD to excess-3 converter
 
05 signal encodingtechniques
05 signal encodingtechniques05 signal encodingtechniques
05 signal encodingtechniques
 
Mac sub layer
Mac sub layerMac sub layer
Mac sub layer
 
Bipolar disorder
Bipolar disorderBipolar disorder
Bipolar disorder
 
IEEE 802.11
IEEE 802.11IEEE 802.11
IEEE 802.11
 
IEEE 802.11
IEEE 802.11IEEE 802.11
IEEE 802.11
 
Line coding
Line coding Line coding
Line coding
 
Distance vector routing algorithm
Distance vector routing algorithmDistance vector routing algorithm
Distance vector routing algorithm
 
wireless network IEEE 802.11
 wireless network IEEE 802.11 wireless network IEEE 802.11
wireless network IEEE 802.11
 
IEEE 802.11
IEEE 802.11IEEE 802.11
IEEE 802.11
 
Distance vector routing
Distance vector routingDistance vector routing
Distance vector routing
 

Similaire à Fpga 10-bcd-to-excess-3-converter-manchester-encoding

Digital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsDigital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsIndira Priyadarshini
 
lecture8_Cuong.ppt
lecture8_Cuong.pptlecture8_Cuong.ppt
lecture8_Cuong.pptHongV34104
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaLisa Hua
 
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
Current Score  –  0 Due  Wednesday, November 19 2014 0400 .docxCurrent Score  –  0 Due  Wednesday, November 19 2014 0400 .docx
Current Score – 0 Due Wednesday, November 19 2014 0400 .docxfaithxdunce63732
 
12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQL12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQLConnor McDonald
 
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
 
Introduction to Polyhedral Compilation
Introduction to Polyhedral CompilationIntroduction to Polyhedral Compilation
Introduction to Polyhedral CompilationAkihiro Hayashi
 
Complete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdfComplete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdfaccess2future1
 
Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...Karthik Rathinavel
 
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingDigital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingIndira Priyadarshini
 

Similaire à Fpga 10-bcd-to-excess-3-converter-manchester-encoding (16)

Digital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential CircuitsDigital System Design-Synchronous Sequential Circuits
Digital System Design-Synchronous Sequential Circuits
 
Tdm to vo ip 2
Tdm to vo ip 2Tdm to vo ip 2
Tdm to vo ip 2
 
lecture8_Cuong.ppt
lecture8_Cuong.pptlecture8_Cuong.ppt
lecture8_Cuong.ppt
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for Java
 
Ver2.ppt
Ver2.pptVer2.ppt
Ver2.ppt
 
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
Current Score  –  0 Due  Wednesday, November 19 2014 0400 .docxCurrent Score  –  0 Due  Wednesday, November 19 2014 0400 .docx
Current Score – 0 Due Wednesday, November 19 2014 0400 .docx
 
10 multiplexers-de mux
10 multiplexers-de mux10 multiplexers-de mux
10 multiplexers-de mux
 
Assignment1
Assignment1Assignment1
Assignment1
 
12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQL12c Mini Lesson - Improved Error Handling in PLSQL
12c Mini Lesson - Improved Error Handling in PLSQL
 
Basic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.pptBasic-VHDL-Constructs1.ppt
Basic-VHDL-Constructs1.ppt
 
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
 
Introduction to Polyhedral Compilation
Introduction to Polyhedral CompilationIntroduction to Polyhedral Compilation
Introduction to Polyhedral Compilation
 
Complete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdfComplete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdf
 
Lec ty
Lec tyLec ty
Lec ty
 
Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...Digital Voltmeter displaying voltage level on a seven segment display and com...
Digital Voltmeter displaying voltage level on a seven segment display and com...
 
Digital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural ModelingDigital System Design-Switchlevel and Behavioural Modeling
Digital System Design-Switchlevel and Behavioural Modeling
 

Plus de Malik Tauqir Hasan

Fpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filterFpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filterMalik Tauqir Hasan
 
Fpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machineFpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machineMalik Tauqir Hasan
 
Fpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineFpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineMalik Tauqir Hasan
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderMalik Tauqir Hasan
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesMalik Tauqir Hasan
 

Plus de Malik Tauqir Hasan (12)

Fpga 13-task-and-functions
Fpga 13-task-and-functionsFpga 13-task-and-functions
Fpga 13-task-and-functions
 
Fpga 12-event-control
Fpga 12-event-controlFpga 12-event-control
Fpga 12-event-control
 
Fpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filterFpga 11-sequence-detector-fir-iir-filter
Fpga 11-sequence-detector-fir-iir-filter
 
Fpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machineFpga 09-behavioral-modeling-moore-machine
Fpga 09-behavioral-modeling-moore-machine
 
Fpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machineFpga 08-behavioral-modeling-mealy-machine
Fpga 08-behavioral-modeling-mealy-machine
 
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adderFpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
Fpga 07-port-rules-gate-delay-data-flow-carry-look-ahead-adder
 
Fpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directivesFpga 06-data-types-system-tasks-compiler-directives
Fpga 06-data-types-system-tasks-compiler-directives
 
Fpga 05-verilog-programming
Fpga 05-verilog-programmingFpga 05-verilog-programming
Fpga 05-verilog-programming
 
Fpga 04-verilog-programming
Fpga 04-verilog-programmingFpga 04-verilog-programming
Fpga 04-verilog-programming
 
Fpga 03-cpld-and-fpga
Fpga 03-cpld-and-fpgaFpga 03-cpld-and-fpga
Fpga 03-cpld-and-fpga
 
Fpga 02-memory-and-pl ds
Fpga 02-memory-and-pl dsFpga 02-memory-and-pl ds
Fpga 02-memory-and-pl ds
 
Fpga 01-digital-logic-design
Fpga 01-digital-logic-designFpga 01-digital-logic-design
Fpga 01-digital-logic-design
 

Dernier

Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...drmarathore
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussDrMSajidNoor
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证ehyxf
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...Call Girls in Nagpur High Profile
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...amitlee9823
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...motiram463
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...MOHANI PANDEY
 
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...tanu pandey
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)kojalkojal131
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...Pooja Nehwal
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 

Dernier (20)

Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Dharwad 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
 
HLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discussHLH PPT.ppt very important topic to discuss
HLH PPT.ppt very important topic to discuss
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
VVIP Pune Call Girls Balaji Nagar (7001035870) Pune Escorts Nearby with Compl...
 
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
Vip Mumbai Call Girls Kalyan Call On 9920725232 With Body to body massage wit...
 
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
(👉Ridhima)👉VIP Model Call Girls Mulund ( Mumbai) Call ON 9967824496 Starting ...
 
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Mayapuri  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Mayapuri (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Chickpet ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
Get Premium Pimple Saudagar Call Girls (8005736733) 24x7 Rate 15999 with A/c ...
 
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...Shikrapur Call Girls Most Awaited Fun  6297143586 High Profiles young Beautie...
Shikrapur Call Girls Most Awaited Fun 6297143586 High Profiles young Beautie...
 
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
(=Towel) Dubai Call Girls O525547819 Call Girls In Dubai (Fav0r)
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Chikhali Call Me 7737669865 Budget Friendly No Advance Booking
 

Fpga 10-bcd-to-excess-3-converter-manchester-encoding

  • 1. ENGR. RASHID FARID CHISHTI LECTURER,DEE, FET, IIUI CHISHTI@IIU.EDU.PK WEEK 10 BCD TO EXCESS 3 CONVERTER MANCHESTER ENCODING FPGA Based System Design Sunday, May 17, 2015 1 www.iiu.edu.pk
  • 2.  A serially-transmitted BCD (8421 code) word is to be converted into an Excess- 3 code  An Excess-3 code word is obtained by adding 3 to the decimal value and taking the binary equivalent.  Excess-3 code is self-complementing !(0011) = 1100 again an excess-3 code !(0100) = 1011 www.iiu.edu.pk Sunday, May 17, 2015 BCD to Excess-3 Code Converter 2 Decimal Digit 8-4-2-1 Code (BCD) Excess-3 Code 0 0000 0011 1 0001 0100 2 0010 0101 3 0011 0110 4 0100 0111 5 0101 1000 6 0110 1001 7 0111 1010 8 1000 1011 9 1001 1100
  • 3. www.iiu.edu.pk Sunday, May 17, 2015 Serial BCD to Excess-3 Code Converter 3
  • 4. www.iiu.edu.pk Sunday, May 17, 2015 Mealy Model State Machine 4 Decimal Digit BCD Code Excess-3 Code 0 0000 0011 1 0001 0100 2 0010 0101 3 0011 0110 4 0100 0111 5 0101 1000 6 0110 1001 7 0111 1010 8 1000 1011 9 1001 1100 S0S0 S1S1 S2S2 S3S3 0/1 0/1 0/0 0/0 S4S4 1/0 S5S5 0/0 0/1 1/0 S6S6 1/1 1/1 1/0 1/1 0/1 reset
  • 5. module BCD_to_Excess_3 (y, x, pstate, clk, reset); output y, pstate; input x, clk, reset; parameter S0 = 3'd0, S1 = 3'd1, S2 = 3'd2, S3 = 3'd3, S4 = 3'd4, S5 = 3'd5, S6 = 3'd6; reg[2: 0] pstate, nxtstate; reg y; always @ (posedge clk or negedge reset) if (reset== 0) pstate <= S0; else pstate <= nxtstate; always @ (pstate or x) begin case (pstate) S0: if (x) begin nxtstate = S4; y = 0; end else begin nxtstate = S1; y = 1; end S1: if (x) begin nxtstate = S5; y = 0; end else begin nxtstate = S2; y = 1; end S2: begin nxtstate = S3; y = x; end S3: begin nxtstate = S0; y = x; end S4: begin nxtstate = S5; y = x; end S5: if (x) begin nxtstate = S6; y = 0; end else begin nxtstate = S3; y = 1; end S6: begin nxtstate = S0; y = 1; end default: begin nxtstate = 3'dx; y = 1'bx; end endcase end endmodule www.iiu.edu.pk Sunday, May 17, 2015 Behavioral Modeling 5
  • 6. module Test_BCD_to_Excess3; wire y; wire [2:0]pstate; reg x, clk, reset; BCD_to_Excess_3 BE1 (y, x, pstate, clk, reset); initial begin reset = 1; #7 reset = 0; #3 reset = 1; end initial begin clk = 0; repeat (20) #5 clk = ~clk; end initial begin x = 1; repeat (10) #10 x = ~ x; end endmodule www.iiu.edu.pk Sunday, May 17, 2015 Test Bench 6 S0S0 S1S1 S2S2 S3S3 0/1 0/1 0/0 0/0 S4S4 1/0 S5S5 0/0 0/1 1/0 S6S6 1/1 1/1 1/0 1/1 0/1 reset
  • 7.  Each bit is transmitted in a fixed time (the "period").  A 0 is expressed by a low-to-high transition, a 1 by high-to-low transition.  The transitions which signify 0 or 1 occur at the midpoint of a period.  Transitions at the start of a period are overhead and don't signify data.  Manchester coding is widely used in Ethernet, RFID and Near Field Communication. www.iiu.edu.pk Sunday, May 17, 2015 Manchester Encoding 7 S1S1 S2S2 0/01/1 0/11/0 S0S0
  • 8. module NRZ_2_Manchester_Mealy (B_out, state, B_in, clock, reset_b); output B_out; input B_in; input clock, reset_b; output state; reg [1: 0] state, next_state; reg B_out; parameter S0 = 0, S1 = 1, S2 = 2, dont_care_state = 2'bx, dont_care_out = 1'bx; always @ (negedge clock or negedge reset_b) if (reset_b == 0) state <= S0; else state <= next_state; always @ (state or B_in ) begin B_out = 0; case (state) S0: if (B_in == 0) begin next_state = S2; B_out = 0; end else if (B_in == 1) begin next_state = S1; B_out = 1; end S1: begin next_state = S0; B_out = 0; end S2: begin next_state = S0; B_out = 1; end default: begin next_state = dont_care_state; B_out = dont_care_out; end endcase end endmodule www.iiu.edu.pk Sunday, May 17, 2015 Manchester Encoding 8 S1S1 S2S2 0/01/1 0/11/0 S0S0
  • 9. module test_NRZ_2_Manchester_Mealy; wire B_out; reg B_in, clk, rst; wire [1:0] state; reg clk2; NRZ_2_Manchester_Mealy (B_out, state, B_in, clk, rst); initial begin rst = 1; #7 rst = 0; #3 rst = 1; end initial begin clk = 0; repeat (20) #5 clk = ~clk; end initial begin clk2 = 1; repeat (10) #10 clk2 = ~clk2; end initial begin B_in = 1; repeat (3) #40 B_in = ~ B_in; end endmodule www.iiu.edu.pk Sunday, May 17, 2015 Manchester Encoding Test Bench 9 S1S1 S2S2 0/01/1 0/11/0 S0S0
  • 10. module test_NRZ_2_Manchester_Mealy; wire B_out; reg B_in, clk, rst; wire [1:0] state; reg clk2; NRZ_2_Manchester_Mealy (B_out, state, B_in, clk, rst); initial begin rst = 1; #7 rst = 0; #3 rst = 1; end initial begin clk = 0; repeat (20) #5 clk = ~clk; end initial begin clk2 = 1; repeat (10) #10 clk2 = ~clk2; end initial begin B_in = 1; repeat (3) #40 B_in = ~ B_in; end endmodule www.iiu.edu.pk Sunday, May 17, 2015 Manchester Encoding Test Bench 9 S1S1 S2S2 0/01/1 0/11/0 S0S0