code stringlengths 35 6.69k | score float64 6.5 11.5 |
|---|---|
module top_module (
input in1,
input in2,
output out
);
assign out = in1 & (~in2);
endmodule
| 7.203305 |
module top_module (
input in1,
input in2,
input in3,
output out
);
assign out = ~(in1 ^ in2) ^ in3;
endmodule
| 7.203305 |
module top_module (
input in1,
input in2,
input in3,
output out
);
assign out = (in1 ~^ in2) ^ in3;
endmodule
| 7.203305 |
module tt2_tholin_multiplier (
input [7:0] io_in,
output [7:0] io_out
);
wire s_A0 = io_in[0];
wire s_A1 = io_in[1];
wire s_A2 = io_in[2];
wire s_A3 = io_in[3];
wire s_B0 = io_in[4];
wire s_B1 = io_in[5];
wire s_B2 = io_in[6];
wire s_B3 = io_in[7];
wire s_R0;
wire s_R1;
wire s_R2;
wire ... | 6.97729 |
module top_module (
input a,
b,
output out_and,
output out_or,
output out_xor,
output out_nand,
output out_nor,
output out_xnor,
output out_anotb
);
assign out_and = a & b;
assign out_or = a | b;
assign out_xor = a ^ b;
assign out_nand = ~(a & b);
assign out_nor = ~(a | b... | 7.203305 |
module top_module (
input a,
b,
output out_and,
output out_or,
output out_xor,
output out_nand,
output out_nor,
output out_xnor,
output out_anotb
);
assign out_and = a & b;
assign out_or = a | b;
assign out_xor = a ^ b;
assign out_nand = ~(a & b);
assign out_nor = ~(a | b... | 7.203305 |
module has a 4-bit input bus as input, and a 7-bit output bus as output.
//
module example_bus(
a,
b
);
input [3:0] a; // <- `a` is 4-bit bus
output [6:0] b; // <- `b` is 7-bit bus
endmodule
| 7.988239 |
module is thus a 3-bit buffer.
//
module buffer3(
in,
out
);
input [2:0] in;
output [2:0] out;
assign out = in; // <- this line performs 3 connections
endmodule
| 8.339893 |
modules checks if its two input buses are identical.
//
module same_buses(
in1,
in2,
all_equal
);
input [3:0] in1;
input [3:0] in2;
output all_equal;
wire [3:0] equal;
assign equal[0] = in1[0] == in2[0];
assign equal[1] = in1[1] == in2[1];
assign equal[2] = in1[2] == in2[2];
assign equal[3] = in1[3... | 6.607486 |
module top_module (
input clk,
input reset, // Synchronous reset
output shift_ena
);
reg cnt_ena = 0;
reg [2:0] cnt;
always @(posedge clk) begin
if (reset) begin
cnt <= 0;
cnt_ena <= 1;
end else begin
if (cnt == 4 - 1) begin
cnt_ena <= 0;
cnt <= cnt;
... | 7.203305 |
module mod3 (
clk,
rst_n,
din,
dout
);
input clk, rst_n, din;
output reg dout;
parameter idle = 2'b00, s1 = 2'b01, s2 = 2'b10, s3 = 2'b11;
reg [1:0] state, next_state;
always @(posedge clk or negedge rst_n)
if (~rst_n) begin
state <= idle;
end else state <= next_state;
alwa... | 7.36043 |
module top_module (
input clk,
input reset, // Synchronous reset to OFF
input j,
input k,
output out
); //
parameter OFF = 0, ON = 1;
reg state, next_state;
always @(*) begin
// State transition logic
case (state)
OFF: next_state = j ? ON : OFF;
ON: next_state = ... | 7.203305 |
module DUAL_FIFO (
clk,
rst_n,
in_data,
out_data,
fifo_empty,
fifo_full,
wr_en,
rd_en
);
parameter Data_Depth = 256;
parameter Data_Width = 8;
parameter Add_Depth = 8; //256的bit位数
input clk, rst_n, wr_en;
input [Data_Width-1:0] in_data;
output wire [Data_Width-1:0] out_data;... | 7.935951 |
module AdderSub (
sum_diff,
carry,
A,
B,
select
);
output [3:0] sum_diff;
output carry;
input [3:0] A, B;
input select;
wire w0, w1, w2, w3;
wire B0, B1, B2, B3;
xor x0 (B0, B[0], select);
xor x1 (B1, B[1], select);
xor x2 (B2, B[2], select);
xor x3 (B3, B[3], select);
assign... | 7.194214 |
module top_module (
input in,
output out
);
assign out = ~in; //~ : bitwise negation operator
endmodule
| 7.203305 |
module top_module (
input in,
output out
);
assign out = ~in;
endmodule
| 7.203305 |
module top_module (
input in,
output out
);
assign out = in;
endmodule
| 7.203305 |
module alu1 (
output [3:0] s,
input [3:0] a,
input [3:0] b
);
xor xor1 (x1, a[3], b[3]);
fa fa1 (
s[0],
w1,
a[0],
b[0],
x1
);
fa fa2 (
s[1],
w2,
a[1],
b[1],
w1
);
fa fa3 (
s[2],
s[3],
a[2],
b[2],
w2
);... | 7.4996 |
module alu2 (
output [3:0] s,
output eqzero,
input [3:0] a,
input [3:0] b
);
xor xor1 (x1, a[3], b[3]);
fa fa1 (
s[0],
w1,
a[0],
b[0],
x1
);
fa fa2 (
s[1],
w2,
a[1],
b[1],
w1
);
fa fa3 (
s[2],
s[3],
a[2],
b[... | 6.924433 |
module alu1 (
output [3:0] s,
output overflow,
input [3:0] a,
input [3:0] b,
input inca,
input incb
);
wire [3:0] k;
xor xor1 (x1, a[3], b[3]);
fa fa1 (
k[0],
w1,
a[0],
b[0],
x1
);
fa fa2 (
k[1],
w2,
a[1],
b[1],
w1
);
fa... | 7.4996 |
module alu1 (
output [3:0] s,
output overflow,
output gr,
output ls,
input [3:0] a,
input [3:0] b,
input inca,
input incb
);
wire [3:0] k;
xor xor1 (x1, a[3], b[3]);
fa fa1 (
k[0],
w1,
a[0],
b[0],
x1
);
fa fa2 (
k[1],
w2,
a[1],
... | 7.4996 |
module top_module (
input p1a,
p1b,
p1c,
p1d,
output p1y,
input p2a,
p2b,
p2c,
p2d,
output p2y
);
assign p1y = ~(p1a & p1b & p1c & p1d);
assign p2y = ~(p2a & p2b & p2c & p2d);
endmodule
| 7.203305 |
module top_module (
input p1a,
p1b,
p1c,
p1d,
output p1y,
input p2a,
p2b,
p2c,
p2d,
output p2y
);
assign p1y = ~(p1a & p1b & p1c & p1d);
assign p2y = ~(p2a & p2b & p2c & p2d);
endmodule
| 7.203305 |
module tt2_tholin_multiplexed_counter (
input [7:0] io_in,
output [7:0] io_out
);
wire s_A;
wire s_B;
wire s_C;
wire s_CLK = io_in[0];
wire s_D;
wire s_E;
wire s_F;
wire s_G;
wire s_RST = io_in[1];
wire s_SEL;
assign io_out[0] = s_A;
assign io_out[1] = s_B;
assign io_out[2] = s_C;
... | 6.97729 |
module github_com_proppy_tt02_xls_counter (
input wire [7:0] io_in,
output wire [7:0] io_out
);
wire rdy = 1;
wire vld;
user_module counter0 (
io_in[0],
io_in[1],
rdy,
io_out,
vld
);
endmodule
| 7.341325 |
module top_module (
input x3,
input x2,
input x1, // three inputs
output f // one output
);
always @(*) begin
if (~x3 & ~x2 & ~x1) f = 1'b0;
else if (~x3 & ~x2 & x1) f = 1'b0;
else if (x3 & ~x2 & ~x1) f = 1'b0;
else if (x3 & x2 & ~x1) f = 1'b0;
else f = 1'b1;
end
endmodu... | 7.203305 |
module top_module (
input x3,
input x2,
input x1, // three inputs
output f // one output
);
assign f = ((~x1) & x2 & (~x3)) | (x1 & x2 & (~x3)) | (x1 & (~x2) & x3) | (x1 & x2 & x3);
endmodule
| 7.203305 |
module top_module (
input [1:0] A,
input [1:0] B,
output z
);
assign z = 1'b1 ? (A == B) : (A != B);
endmodule
| 7.203305 |
module top_module (
input [1:0] A,
input [1:0] B,
output z
);
assign z = (A == B) ? 1'b1 : 1'b0;
endmodule
| 7.203305 |
module top_module (
input x,
input y,
output z
);
assign z = (x ^ y) & x;
endmodule
| 7.203305 |
module top_module (
input x,
input y,
output z
);
assign z = (x ^ y) & x;
endmodule
| 7.203305 |
module top_module (
input x,
input y,
output z
);
assign z = (~x & ~y) | (x & y);
endmodule
| 7.203305 |
module top_module (
input x,
input y,
output z
);
assign z = x ~^ y;
endmodule
| 7.203305 |
module top_module (
input x,
input y,
output z
);
wire z1, z2, z3, z4;
IA IA_u0 (
.x(x),
.y(y),
.z(z1)
);
IB IB_u0 (
.x(x),
.y(y),
.z(z2)
);
IA IA_u1 (
.x(x),
.y(y),
.z(z3)
);
IB IB_u1 (
.x(x),
.y(y),
.z(z4)
);
... | 7.203305 |
module IA (
input x,
input y,
output z
);
assign z = (x ^ y) & x;
endmodule
| 7.865739 |
module top_module (
input x,
input y,
output z
);
wire z_A_1;
wire z_A_2;
wire z_B_1;
wire z_B_2;
A ia1 (
.x(x),
.y(y),
.z(z_A_1)
);
A ia2 (
.x(x),
.y(y),
.z(z_A_2)
);
B ib1 (
.x(x),
.y(y),
.z(z_B_1)
);
B ib2 (
.x(x),
... | 7.203305 |
module A
module A (
input x,
input y,
output z);
assign z = (x ^ y) & x;
endmodule
| 8.261177 |
module B
module B ( input x, input y, output z );
assign z = x ~^ y;
endmodule
| 8.891839 |
module jleightcap_top (
input wire [7:0] io_in
, output wire [7:0] io_out
);
top _top (
.clk(io_in[0])
, .rst(io_in[1])
, .instr(io_in[7:2])
, .io_out(io_out)
);
endmodule
| 7.906323 |
module top_module (
input ring,
input vibrate_mode,
output ringer, // Make sound
output motor // Vibrate
);
assign ringer = (ring & ~vibrate_mode);
assign motor = (ring & vibrate_mode);
endmodule
| 7.203305 |
module top_module (
input ring,
input vibrate_mode,
output ringer, // Make sound
output motor // Vibrate
);
assign ringer = ring & (~vibrate_mode);
assign motor = ring & vibrate_mode;
endmodule
| 7.203305 |
module top_module (
input too_cold,
input too_hot,
input mode,
input fan_on,
output heater,
output aircon,
output fan
);
assign heater = mode & too_cold;
assign aircon = ~mode & too_hot;
assign fan = heater | aircon | fan_on;
endmodule
| 7.203305 |
module top_module (
input [2:0] in,
output [1:0] out
);
assign out = in[2] + in[1] + in[0];
endmodule
| 7.203305 |
module top_module (
input [3:0] in,
output [2:0] out_both,
output [3:1] out_any,
output [3:0] out_different
);
assign out_both = {in[3] & in[2], in[2] & in[1], in[1] & in[0]};
assign out_any = {in[3] | in[2], in[2] | in[1], in[1] | in[0]};
assign out_different = {in[0] ^ in[3], in[3] ^ in[2], in... | 7.203305 |
module top_module (
input [2:0] in,
output [1:0] out
);
assign out[1] = (in[2] & in[1] | in[2] & in[0] | in[1] & in[0]);
assign out[0] = (~in[2])&(~in[1])&(in[0]) | (~in[2])&(in[1])&(~in[0]) | (in[2])&(~in[1])&(~in[0]) | (in[2])&(in[1])&(in[0]);
endmodule
| 7.203305 |
module krasin_3_bit_8_channel_pwm_driver (
input [7:0] io_in,
output [7:0] io_out
);
wire clk = io_in[0];
wire pset = io_in[1];
wire [2:0] addr = io_in[4:2];
wire [2:0] level = io_in[7:5];
wire [7:0] pwm_out;
assign io_out[7:0] = pwm_out;
// This register is used to determine if the execution ... | 7.687409 |
module top_module (
input [3:0] in,
output [2:0] out_both,
output [3:1] out_any,
output [3:0] out_different
);
assign out_both = {(in[3] & in[2]), (in[2] & in[1]), (in[1] & in[0])};
assign out_any = {(in[3] | in[2]), (in[2] | in[1]), (in[1] | in[0])};
assign out_different = {(in[0] ^ in[3]), (in... | 7.203305 |
module top_module (
// input [3:0] in,
// output [2:0] out_both,
// output [3:1] out_any,
// output [3:0] out_different
// );
// // Use bitwise operators and part-select to do the entire calculation in one line of code
// // in[3:1] is this vector: in[3] in[2] in[1]
// // in[2:0] is this vector: ... | 7.203305 |
module top_module (
input clk,
input reset, // Synchronous reset
input data,
output shift_ena,
output counting,
input done_counting,
output done,
input ack
);
parameter IDLE = 0, SEQ_0 = 1, SEQ_1 = 2, SEQ_2 = 3;
parameter SHIFT = 4, COUNT = 5, DONE = 6;
reg [2:0] cst... | 7.203305 |
module:send part
//author:WangFW
//date:2020-5-2
module shake_hand_send(clk,rst_n,ack,din,dout,ready);
input clk,rst_n;
input ack;
input [7:0] din;
output reg [7:0] dout;
output reg ready;
reg ack_d1,ack_d2;
reg [1:0] state,next_state;
parameter idle=2'b00,send=2'b01,ack_active=2'b10,ack_check=2'b11;
reg [7... | 6.750339 |
module shake_hand_send_tb ();
reg clk, rst_n;
reg ack;
reg [7:0] din;
wire ready;
wire [7:0] dout;
initial begin
clk = 0;
rst_n = 1;
ack = 0;
din = 8'd0;
#10 rst_n = 0;
#10 rst_n = 1;
#10 din = 8'b1010_1010;
#10 ack = 1'b1;
#10 ack = 1'b0;
end
always #2 clk <=... | 6.619686 |
module top_module (
input in,
input [1:0] state,
output [1:0] next_state,
output out
); //
parameter A = 0, B = 1, C = 2, D = 3;
// State transition logic: next_state = f(state, in)
assign next_state = in ? ((state == C) ? D : B) : (((state == C) | (state == A)) ? A : C);
// Output logic: ... | 7.203305 |
module top_module (
input a,
input b,
output out
);
assign out = a & b; // & : Bit-wise and operator
endmodule
| 7.203305 |
module top_module (
input a,
input b,
output out
);
assign out = a && b;
endmodule
| 7.203305 |
module top_module (
input a,
b,
c,
output w,
x,
y,
z
);
assign w = a;
assign x = b;
assign y = b;
assign z = c;
endmodule
| 7.203305 |
module pulse2 (
signal,
clock
);
input clock;
output signal;
reg signal;
always @(posedge clock) begin
signal = 1'b1;
#5 signal = 1'b0;
end
endmodule
| 6.524618 |
module pulse3 (
signal,
clock
);
input clock;
output signal;
reg signal;
always @(negedge clock) begin
signal = 1'b1;
#15 signal = 1'b0;
#15 signal = 1'b1;
end
endmodule
| 6.545395 |
module top_module (
input [99:0] in,
output [98:0] out_both,
output [99:1] out_any,
output [99:0] out_different
);
assign out_both = in[99:1] & in[98:0];
assign out_any = in[99:1] | in[98:0];
assign out_different = {in[0], in[99:1]} ^ in[99:0];
endmodule
| 7.203305 |
module cchan_fp8_multiplier (
input [7:0] io_in,
output [7:0] io_out
);
wire clk = io_in[0];
wire [2:0] ctrl = io_in[3:1];
wire [3:0] data = io_in[7:4];
// wire [6:0] led_out;
// assign io_out[6:0] = led_out;
// wire [5:0] seed_input = io_in[7:2];
reg [8:0] operand1;
reg [8:0] operand2;
// F... | 7.207859 |
module fp8mul (
input sign1,
input [3:0] exp1,
input [2:0] mant1,
input sign2,
input [3:0] exp2,
input [2:0] mant2,
output sign_out,
output [3:0] exp_out,
output [2:0] mant_out
);
parameter EXP_BIAS = 7;
wire isnan = (sign1 == 1 && exp1 == 0 && mant1 == 0) || (sign2 == 1 && exp... | 7.084548 |
module top_module (
input [99:0] in,
output reg [98:0] out_both,
output reg [99:1] out_any,
output reg [99:0] out_different
);
integer i;
always @(*) begin
for (i = 98; i >= 0; i = i - 1) begin
out_both[i] = in[i+1] & in[i];
end
for (i = 99; i >= 1; i = i - 1) begin
out_any... | 7.203305 |
module top_module (
input a,
b,
sel,
output out
);
assign out = sel ? b : a;
endmodule
| 7.203305 |
module top_module (
input a,
b,
sel,
output out
);
assign out = sel ? b : a;
endmodule
| 7.203305 |
module tt2_tholin_diceroll (
input [7:0] io_in,
output [7:0] io_out
);
wire CLK = io_in[0];
wire RST = io_in[1];
wire ROLL = io_in[2];
wire [7:0] LEDS;
assign io_out[7:0] = LEDS;
dice dice (
.CLK (CLK),
.RST (RST),
.ROLL(ROLL),
.LEDS(LEDS)
);
endmodule
| 7.397118 |
module top_module (
input [99:0] a,
b,
input sel,
output [99:0] out
);
assign out = sel ? b : a;
endmodule
| 7.203305 |
module top_module (
input [99:0] a,
b,
input sel,
output [99:0] out
);
assign out = sel ? b : a;
endmodule
| 7.203305 |
module top_module (
input [15:0] a,
b,
c,
d,
e,
f,
g,
h,
i,
input [ 3:0] sel,
output [15:0] out
);
always @(*) begin
case (sel)
4'd0: out = a;
4'd1: out = b;
4'd2: out = c;
4'd3: out = d;
4'd4: out = e;
4'd5: out = f;
4'd6: o... | 7.203305 |
module top_module (
input [15:0] a,
b,
c,
d,
e,
f,
g,
h,
i,
input [3:0] sel,
output reg [15:0] out
);
always @(*) begin
case (sel)
4'b0000: out = a;
4'b0001: out = b;
4'b0010: out = c;
4'b0011: out = d;
4'b0100: out = e;
4'b0101: out... | 7.203305 |
module top_module (
input [255:0] in,
input [7:0] sel,
output out
);
assign out = in[sel];
endmodule
| 7.203305 |
module top_module (
input [255:0] in,
input [7:0] sel,
output reg out
);
integer i;
always @(*) begin
out = 1'b0;
for (i = 0; i <= 255; i = i + 1) begin
if (sel == i) out = in[i];
end
end
endmodule
| 7.203305 |
module top_module (
input [1023:0] in,
input [7:0] sel,
output [3:0] out
);
assign out = {in[{sel, 2'b11}], in[{sel, 2'b10}], in[{sel, 2'b01}], in[{sel, 2'b00}]};
endmodule
| 7.203305 |
module top_module (
input [1023:0] in,
input [7:0] sel,
output reg [3:0] out
);
integer i;
always @(*) begin
out = 4'b0000;
for (i = 0; i <= 255; i = i + 1) begin
if (sel == i) out = {in[4*i+3], in[4*i+2], in[4*i+1], in[4*i]};
end
end
endmodule
| 7.203305 |
module top_module (
input a,
b,
output cout,
sum
);
assign cout = a & b;
assign sum = a ^ b;
endmodule
| 7.203305 |
module top_module (
input a,
b,
output cout,
sum
);
assign {cout, sum} = a + b;
endmodule
| 7.203305 |
module top_module (
input a,
b,
cin,
output cout,
sum
);
assign {cout, sum} = a + b + cin;
endmodule
| 7.203305 |
module top_module (
input a,
b,
cin,
output cout,
sum
);
assign cout = (a & b) | (a & cin) | (b & cin);
assign sum = a ^ b ^ cin;
endmodule
| 7.203305 |
module top_module (
input [2:0] a,
b,
input cin,
output [2:0] cout,
output [2:0] sum
);
wire [2:0] new_cin;
assign new_cin = {cout[1:0], cin};
assign cout = (a & b) | (a & new_cin) | (b & new_cin);
assign sum = a ^ b ^ new_cin;
endmodule
| 7.203305 |
module top_module (
input [2:0] a,
b,
input cin,
output [2:0] cout,
output [2:0] sum
);
genvar i;
generate
begin
for (i = 0; i <= 2; i = i + 1) begin : adder_loop
if (i == 0)
adder1 u_adder1 (
.a(a[0]),
.b(b[0]),
.cin(cin),
... | 7.203305 |
module adder1 (
input a,
input b,
input cin,
output cout,
output sum
);
assign {cout, sum} = a + b + cin;
endmodule
| 7.322982 |
module top_module (
input [3:0] x,
input [3:0] y,
output [4:0] sum
);
wire [3:0] cin, cout;
assign cin = {cout[2:0], 1'b0};
assign cout = (x & y) | (x & cin) | (y & cin);
assign sum = {cout[3], x ^ y ^ cin};
endmodule
| 7.203305 |
module user_module_341164910646919762 (
input wire [7:0] io_in,
output wire [7:0] io_out
);
wire clk = io_in[0];
wire output_select = io_in[1];
wire gold_out;
gold_code_module_341164910646919762 gold_code_generator (
.clk(clk),
.loadn(io_in[3]),
.b_load({io_in[7:4], io_in[2:1]}),
... | 6.857392 |
module_341164910646919762
module gold_code_module_341164910646919762
(
input wire clk,
input wire loadn,
input wire [5:0] b_load,
output wire gold
);
reg [12:0] a;
reg [6:0] b_async;
reg [5:0] b_sync;
wire [12:0] b = {b_async, b_sync};
always @(posedge clk or negedge loadn) b... | 7.129824 |
module_341164910646919762
module fibonacci_module_341164910646919762
#(
parameter DIGITS = 7
)
(
input wire clk,
input wire rstn,
output wire [7:0] io_out
);
wire [3:0] digit;
wire lsb_marker;
fibonacci_341164910646919762 #(.DIGITS(DIGITS)) fi... | 7.129824 |
module_341164910646919762
module fibonacci_341164910646919762
#(
parameter DIGITS = 7
)
(
input wire clk,
input wire rstn,
output wire [3:0] digit,
output wire lsb_marker
);
localparam WIDTH = 4 * DIGITS;
reg [WIDTH-1:0] a;
assign digit = a[3:0... | 7.129824 |
module adder4_341164910646919762 (
input wire [3:0] a,
input wire [3:0] b,
input wire cin,
output wire [3:0] sum,
output wire cout
);
wire [3:0] adder_cin;
wire [3:0] adder_cout;
assign cout = adder_cout[3];
assign adder_cin = {adder_cout[2:0], cin};
sky130_fd_sc_hd__fa_1 ... | 7.315542 |
module constants;
wire [2:0] a;
wire [3:0] b;
wire [4:0] c;
assign a = 3'b000; // The three bits of `a` are set to 0.
assign b = 4'hc; // `b` is set to 12, thus `b == 4'b1100`
assign c = 5'd13; // `c` is set to 13, thus `c == 5'b01101`
wire d;
wire [4:0] e;
assign d = |(b & 4'b0011); // `d`... | 6.857409 |
module constants_underscore;
wire [7:0] a;
wire [7:0] b;
wire same;
assign a = 8'b00010111;
assign b = 8'b0001_0111;
assign same = a == b; // `same` is here equal to 1
endmodule
| 7.113009 |
module shake_hand_recv (
clk,
rst_n,
ready,
din,
dout,
ack
);
input clk, rst_n;
input ready;
input [7:0] din;
output reg [7:0] dout;
output reg ack;
reg ready_d1, ready_d2;
parameter idle = 2'b00, recv = 2'b01, active = 2'b10, reset = 2'b11;
reg [1:0] state, next_state;
alw... | 6.719216 |
module shake_hand_recv_tb ();
reg clk, rst_n;
reg ready;
reg [7:0] din;
wire [7:0] dout;
wire ack;
initial begin
clk = 0;
rst_n = 1;
ready = 0;
din = 8'd0;
#10 rst_n = 0;
#10 rst_n = 1;
#10 din = 7'b1010_1010;
ready = 1;
#10 din = 8'd0;
#10 ready = 0;
end
a... | 6.719216 |
module top_module (
input in,
input [3:0] state,
output [3:0] next_state,
output out
); //
parameter A = 0, B = 1, C = 2, D = 3;
// State transition logic: Derive an equation for each state flip-flop.
assign next_state[A] = (state[A] & (~in)) | (state[C] & (~in));
assign next_state[B] = in & ... | 7.203305 |
module top_module (
input clk,
input reset, // Synchronous reset
input data,
output [3:0] count,
output counting,
output done,
input ack
);
parameter IDLE = 0, SEQ_0 = 1, SEQ_1 = 2, SEQ_2 = 3;
parameter SHIFT = 4, COUNT = 5, DONE = 6;
reg [... | 7.203305 |
module top_module (
input a,
input b,
output out
);
assign out = ~(a | b); //NOR gate using bitwise OR and NOT operators
endmodule
| 7.203305 |
module top_module (
input a,
input b,
output out
);
assign out = ~(a || b);
endmodule
| 7.203305 |
module top_module (
input p1a,
p1b,
p1c,
p1d,
p1e,
p1f,
output p1y,
input p2a,
p2b,
p2c,
p2d,
output p2y
);
wire and1 = p2a && p2b;
wire and2 = p2c && p2d;
assign p2y = and1 || and2;
wire and3 = p1a && p1c && p1b;
wire and4 = p1f && p1e && p1d;
assign p1y =... | 7.203305 |
module ex0701;
reg clk, reset, x;
wire m1, m2;
mealy mealy1 (
m1,
x,
clk,
reset
);
moore moore1 (
m2,
x,
clk,
reset
);
initial begin
$display("Time X Mealy Moore");
//initial values
clk = 1;
reset = 0;
x = 0;
//input signa... | 7.064091 |
module top_module (
input signed [7:0] a,
input signed [7:0] b,
output signed [7:0] s,
output overflow
);
assign s = a + b;
assign overflow = (a[7] & b[7] & ~s[7]) | (~a[7] & ~b[7] & s[7]);
endmodule
| 7.203305 |
module top_module (
input [7:0] a,
input [7:0] b,
output [7:0] s,
output overflow
); //
// assign s = ...
// assign overflow = ...
assign s = a + b;
assign overflow = (a[7] == b[7] && s[7] != a[7]) ? 1 : 0;
endmodule
| 7.203305 |
module top_module (
input [99:0] a,
b,
input cin,
output cout,
output [99:0] sum
);
assign {cout, sum} = a + b + cin;
endmodule
| 7.203305 |
module top_module (
input [99:0] a,
b,
input cin,
output cout,
output [99:0] sum
);
assign {cout, sum} = a + b + cin;
endmodule
| 7.203305 |
module top_module (
input [15:0] a,
b,
input cin,
output cout,
output [15:0] sum
);
wire [3:0] cout_fadd;
bcd_fadd bcd_fadd_u0[3:0] (
.a(a),
.b(b),
.cin({cout_fadd[2:0], cin}),
.cout(cout_fadd),
.sum(sum)
);
assign cout = cout_fadd[3];
endmodule
| 7.203305 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.