Appearing further below is the atoi_it from the solution to Homework 2. (a) Show the hardware inferred for an atoi_it module instantiated with r=14 (yes, radix 14) and n=3.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Problem 2: Appearing further below is the atoi_it from the solution to Homework 2.
(a) Show the hardware inferred for an atoi_it module instantiated with r=14 (yes, radix 14) and

n=3.

Show atoi1, mult_by_c, and add instances as modules, do not show what is inside.

Show the hardware inferred for the operators, such as && and ?:.

Do not confuse parameters and ports.

Omit hardware that does not belong, such as "hardware" to compute values needed at elaboration time.

Be sure to show the inferred logic. Remember that generate statements describe what hap- pens at elaboration time, not what happens at simulation time nor does it describe operations performed by the hardware.

(b) Show the hardware inferred for an atoi_it module instantiated with r=16 (hexadecimal this time) and n=3, and show the hardware after optimization. Consider the impact of optimization on the mult_by_c and add modules, which should be considerable since r is a power of 2.

3

module atoi_it
#( int r = 11, n = 5, wv = $clog2( r**n ), wd = $clog2(n+1) )

   ( output logic [wv-1:0] val,     output logic [wd-1:0] nd,     input uwire [7:0] str [n-1:0] );

uwire [wv-1:0] vali[n-1:-1]; uwire is_valid[n-1:-1]; uwire [wd-1:0] ndi[n-1:-1]; assign is_valid[-1] = 1; assign ndi[-1] = 0;

assign vali[-1] = 0; assign nd = ndi[n-1]; assign val = vali[n-1];

   localparam int wcv = $clog2(r);   for ( genvar i=0; i<n; i++ ) begin      // Find Value of Digit i      //      uwire [wcv-1:0] valdr;      uwire is_digit;

atoi1 #(r,wcv) a( valdr, is_digit, str[i] );

// Determine if this digit continues a sequence of valid digits // starting at str[0].
//
assign is_valid[i] = is_digit && is_valid[i-1];

// Replace value with zero if str[i] is not a digit, or if the // string of valid digits has already ended.
//
uwire [wcv-1:0] vald = is_valid[i] ? valdr : 0;

// Multiply (scale) the digit value based on its position in the number. //
uwire [wv-1:0] vals;
mult_by_c #( .w_in(wcv), .c(r**i), .w_out(wv) ) mc( vals, vald );

// Add the scaled digit to the value accumulated so far. //
add #(wv) a1( vali[i], vali[i-1], vals );

// Update the number of digits so far.
//
assign ndi[i] = is_valid[i] ? i+1 : ndi[i-1];

end

endmodule

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Properties of Different Architectures
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education