mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 03:32:29 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			242 B
		
	
	
	
		
			Verilog
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			242 B
		
	
	
	
		
			Verilog
		
	
	
	
	
	
| module tristate (en, i, o);
 | |
|     input en;
 | |
|     input i;
 | |
|     output o;
 | |
| 
 | |
| 	assign o = en ? i : 1'bz;
 | |
| 
 | |
| endmodule
 | |
| 
 | |
| 
 | |
| module top (
 | |
| input en,
 | |
| input a,
 | |
| output b
 | |
| );
 | |
| 
 | |
| tristate u_tri (
 | |
|         .en (en ),
 | |
|         .i (a ),
 | |
|         .o (b )
 | |
|     );
 | |
| 
 | |
| endmodule
 |