Diff
checker
टेक्स्ट
टेक्स्ट
छवियां
दस्तावेज़
Excel
फ़ोल्डर्स
Legal
Enterprise
डेस्कटॉप
मूल्य
साइन इन करें
Diffchecker डेस्कटॉप डाउनलोड करें
टेक्स्ट की तुलना करें
दो टेक्स्ट फ़ाइलों के बीच अंतर ढूंढें
उपकरण
इतिहास
रियल-टाइम एडिटर
अपरिवर्तित संक्षिप्त करें
लाइन रैप बंद
लेआउट
विभाजित
संयुक्त
परिवर्तन हाइलाइट करें
स्मार्ट
शब्द
अक्षर
सिंटैक्स हाइलाइटिंग
सिंटैक्स चुनें
अनदेखा करें
टेक्स्ट बदलें
पहले अंतर पर जाएँ
इनपुट संपादित करें
Diffchecker Desktop
Diffchecker चलाने का सबसे सुरक्षित तरीका। Diffchecker Desktop ऐप पाएं: आपके diffs कभी आपके कंप्यूटर से बाहर नहीं जाते!
Desktop पाएं
Untitled diff
बनाया गया
9 वर्ष पहले
Diff कभी समाप्त नहीं होता
साफ़
निर्यात करें
शेयर करें
समझाएं
15 हटाए गए
लाइनें
कुल
हटाया गया
अक्षर
कुल
हटाया गया
इस सुविधा का उपयोग जारी रखने के लिए, अपग्रेड करें
Diff
checker
Pro
मूल्य देखें
48 लाइनें
सभी को कॉपी करें
12 जोड़े गए
लाइनें
कुल
जोड़ा गया
अक्षर
कुल
जोड़ा गया
इस सुविधा का उपयोग जारी रखने के लिए, अपग्रेड करें
Diff
checker
Pro
मूल्य देखें
48 लाइनें
सभी को कॉपी करें
/************************************************
/************************************************
The Verilog HDL code example is from the book
The Verilog HDL code example is from the book
Computer Principles and Design in Verilog HDL
Computer Principles and Design in Verilog HDL
by Yamin Li, published by A JOHN WILEY & SONS
by Yamin Li, published by A JOHN WILEY & SONS
************************************************/
************************************************/
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
module div_
restoring (a,b,start,clk,clrn,q,r,busy,ready,count);
module div_
non
restoring (a,b,start,clk,clrn,q,r,busy,ready,count);
input [31:0] a; // dividend
input [31:0] a; // dividend
input [15:0] b; // divisor
input [15:0] b; // divisor
input start; // start
input start; // start
input clk, clrn; // clk,reset
input clk, clrn; // clk,reset
output [31:0] q; // quotient
output [31:0] q; // quotient
output [15:0] r; // remainder
output [15:0] r; // remainder
output reg busy; // busy
output reg busy; // busy
output reg ready; // ready
output reg ready; // ready
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
output [4:0] count; // count
er
output [4:0] count; // count
reg [31:0] reg_q;
reg [31:0] reg_q;
reg [15:0] reg_r;
reg [15:0] reg_r;
reg [15:0] reg_b;
reg [15:0] reg_b;
reg [4:0] count;
reg [4:0] count;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
wire [16:0] sub_
out
=
{reg_r,reg_q[31]}
-
{1'b0,reg_b}
; // sub
wire [16:0] sub_
add
=
reg_r[15]?
wire [15:0] mux_out = sub_out[16]?
//
restoring
{reg_r,reg_q[31]}
+
{1'b0,reg_b}
:
//
+ b
{reg_r
[14:0]
,reg_q[31]}
: sub_out[15:0];
//
or not
{reg_r
,reg_q[31]}
- {1'b0,reg_b};
//
- b
assign q = reg_q;
assign q = reg_q;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
assign r = reg_r
;
assign r = reg_r
[15]? reg_r + reg_b : reg_r; // adjust r
always @ (posedge clk or negedge clrn) begin
always @ (posedge clk or negedge clrn) begin
if (!clrn) begin
if (!clrn) begin
busy <= 0;
busy <= 0;
ready <= 0;
ready <= 0;
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
end else begin
end else begin
if (start) begin
if (start) begin
reg_q <= a; // load a
reg_q <= a; // load a
reg_b <= b; // load b
reg_b <= b; // load b
reg_r <= 0;
reg_r <= 0;
busy <= 1;
busy <= 1;
ready <= 0;
ready <= 0;
count <= 0;
count <= 0;
end else if (busy) begin
end else if (busy) begin
कॉपी
कॉपी हुआ
कॉपी
कॉपी हुआ
reg_q <= {reg_q[30:0],~sub_
out
[16]}; // << 1
reg_q <= {reg_q[30:0],~sub_
add
[16]}; // << 1
reg_r <=
mux_out
;
reg_r <=
sub_add[15:0]
;
count <= count + 5'b1; // count
er
++
count <= count + 5'b1; // count
++
if (count == 5'h1f) begin // finish
ed
if (count == 5'h1f) begin // finish
busy <= 0;
busy <= 0;
ready <= 1; // q,r ready
ready <= 1; // q,r ready
end
end
end
end
end
end
end
end
endmodule
endmodule
सेव किए गए Diffs
ऑरिजनल टेक्स्ट
फ़ाइल खोलें
/************************************************ The Verilog HDL code example is from the book Computer Principles and Design in Verilog HDL by Yamin Li, published by A JOHN WILEY & SONS ************************************************/ module div_restoring (a,b,start,clk,clrn,q,r,busy,ready,count); input [31:0] a; // dividend input [15:0] b; // divisor input start; // start input clk, clrn; // clk,reset output [31:0] q; // quotient output [15:0] r; // remainder output reg busy; // busy output reg ready; // ready output [4:0] count; // counter reg [31:0] reg_q; reg [15:0] reg_r; reg [15:0] reg_b; reg [4:0] count; wire [16:0] sub_out = {reg_r,reg_q[31]} - {1'b0,reg_b}; // sub wire [15:0] mux_out = sub_out[16]? // restoring {reg_r[14:0],reg_q[31]} : sub_out[15:0]; // or not assign q = reg_q; assign r = reg_r; always @ (posedge clk or negedge clrn) begin if (!clrn) begin busy <= 0; ready <= 0; end else begin if (start) begin reg_q <= a; // load a reg_b <= b; // load b reg_r <= 0; busy <= 1; ready <= 0; count <= 0; end else if (busy) begin reg_q <= {reg_q[30:0],~sub_out[16]}; // << 1 reg_r <= mux_out; count <= count + 5'b1; // counter++ if (count == 5'h1f) begin // finished busy <= 0; ready <= 1; // q,r ready end end end end endmodule
परिवर्तित टेक्स्ट
फ़ाइल खोलें
/************************************************ The Verilog HDL code example is from the book Computer Principles and Design in Verilog HDL by Yamin Li, published by A JOHN WILEY & SONS ************************************************/ module div_nonrestoring (a,b,start,clk,clrn,q,r,busy,ready,count); input [31:0] a; // dividend input [15:0] b; // divisor input start; // start input clk, clrn; // clk,reset output [31:0] q; // quotient output [15:0] r; // remainder output reg busy; // busy output reg ready; // ready output [4:0] count; // count reg [31:0] reg_q; reg [15:0] reg_r; reg [15:0] reg_b; reg [4:0] count; wire [16:0] sub_add = reg_r[15]? {reg_r,reg_q[31]} + {1'b0,reg_b} : // + b {reg_r,reg_q[31]} - {1'b0,reg_b}; // - b assign q = reg_q; assign r = reg_r[15]? reg_r + reg_b : reg_r; // adjust r always @ (posedge clk or negedge clrn) begin if (!clrn) begin busy <= 0; ready <= 0; end else begin if (start) begin reg_q <= a; // load a reg_b <= b; // load b reg_r <= 0; busy <= 1; ready <= 0; count <= 0; end else if (busy) begin reg_q <= {reg_q[30:0],~sub_add[16]}; // << 1 reg_r <= sub_add[15:0]; count <= count + 5'b1; // count++ if (count == 5'h1f) begin // finish busy <= 0; ready <= 1; // q,r ready end end end end endmodule
अंतर खोजें