Forum Discussion
Altera_Forum
Honored Contributor
9 years agoInitial value assignments in (reg [5:0] init= 6’d32; ) will not synthesize. If you need to initialize a register, use reset pin and assign its initial value when that reset activates.
For your example, try the following code: output [5:0] out; reg [5:0] init; assign init = 6’d32; assign out=init; The output will be 6'd32 constantly. For clock constraining, you should consider the worst case frequency of your switch and define a clock with the highest frequency which may occur. Keep in mind however that this is NOT a good practice. Instead use synchronous sampling of the switch using a sufficiently high speed clock source.