Hello, im trying to build a D-FF using HDL Coder in Simulink without a clock trigger signal. The trigger signal I desire is generated outside the subsystem and fed as an input to the subsystem. Whenever I convert the model into HDL, inputs that are not included in the subsystem are added (such as clk, clk_enable). Is there a way to model a DFF with a trigger signal that is not a system clock and translate it into HDL using HDL Coder?
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
error_sample u_error_sample (.Trigger(error_sample_1), .reset(reset), .In1(Switch_out1), // ufix6 .vsampled_latch(error_sample_out1) // ufix6 ); `timescale 1 ns / 1 ns module error_sample (Trigger, reset, In1, vsampled_latch); input Trigger; input reset; input [5:0] In1; // ufix6 output [5:0] vsampled_latch; // ufix6 reg [5:0] In1_hold; // ufix6 always @(posedge Trigger or posedge reset) // <=== input Trigger signal used as clock signal begin : vsampled_latch_hold_process if (reset == 1'b1) begin In1_hold <= 6'b000000; end else begin In1_hold <= In1; end end assign vsampled_latch = In1_hold; endmodule // error_sample
Please check the attached generated code for the model.
Comments
Post a Comment