prepared by ins. arwa al-issa · 2014. 4. 18. · to add a port, click the new button and type the...

50
Prepared By Ins. Arwa Al-Issa I.Arwa Al-Issa

Upload: others

Post on 02-Mar-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

Prepared By Ins. Arwa Al-Issa

I.Arwa Al-Issa

Page 2: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

The purpose of this program is to write a correct verilog code that represent the primitive gates.

Verilog Structure:

1. Start with module and ends with endmodule.

2. Input and Output variables.

3. Wires.

4. The primitive gates: NOT, AND, OR, NAND, NOR, XOR,XNOR

I.Arwa Al-Issa

Page 3: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

module AND2gate(A, B, F);

input A;

input B;

output F;

and (F, A, B);

endmodule

I.Arwa Al-Issa

Page 4: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

Verilog Code representation Gate

not (notA, A) A’ NOT

and (F,A,B) F=A . B AND

or (F,A,B) F=A + B OR

nand (F,A,B) F=(A . B)’ NAND

nor (F,A,B) F=(A + B)’ NOR

xor (F,A,B) F=A B XOR

xnor (F,A,B) F=(A B)’ XNOR

I.Arwa Al-Issa

Page 5: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

F Y X

0 0 0

0 1 0

0 0 1

1 1 1

Page 6: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

0 0 0 0 0

0 1

1 0

1 1 1

Page 7: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

Starting Active DHL

“Verilog”

I.Arwa Al-Issa

Page 8: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 9: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 10: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 11: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 12: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 13: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 14: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 15: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 16: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 17: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 18: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 19: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

Define the following ports: Input Ports: - X - Y

Output Port: - F

Click the Finish button.

I.Arwa Al-Issa

Page 20: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

To add a port, click the New button and type the name of a port.

To change a port type, click the appropriate button in the Port direction box. There are four types: In Out Inout Buffer

To remove any port, click its name on the list and click the Delete button.

To create a bus, add a new port name and click the Array Indexes arrows to specify the bus width.

I.Arwa Al-Issa

Page 21: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 22: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 23: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 24: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 25: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 26: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 27: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 28: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 29: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 30: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 31: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 32: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 33: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 34: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 35: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 36: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 37: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 38: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 39: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 40: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 41: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 42: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 43: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

F Y X

0 0 0

0 1 0

0 0 1

1 1 1

Page 44: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

implement the following function in Verilog:

F=BC+ABC

I.Arwa Al-Issa

F A’BC’ BC C’ A’ C B A

0 0 0 1 1 0 0 0

0 0 0 0 1 1 0 0

1 1 0 1 1 0 1 0

1 0 1 0 1 1 1 0

0 0 0 1 0 0 0 1

0 0 0 0 0 1 0 1

0 0 0 1 0 0 1 1

1 0 1 0 0 1 1 1

Page 45: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

module Function(A, B,C, F); input A, B, C; output F; wire notA , notC; wire Y1, Y2; and (Y1,B,C); not (notA, A); not (notC, C); and (Y2, notA, B , notC); or (F, Y1, Y2); endmodule

I.Arwa Al-Issa

Page 46: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 47: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 48: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 49: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

I.Arwa Al-Issa

Page 50: Prepared By Ins. Arwa Al-Issa · 2014. 4. 18. · To add a port, click the New button and type the name of a port. To change a port type, click the appropriate button in the Port

Thanks

I.Arwa Al-Issa