FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > Verilog

Verilog comp.lang.verilog newsgroup / usenet

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-23-2003, 11:20 PM
slxrti
Guest
 
Posts: n/a
Default newbie: connecting two half to one full adder using hierarchial model

I would like to make a full adder from two half adder. I use a
hierarchial
model for the the full adder.

How do I connect a output of one instance with a input of anther I
tried declaring a wirer to connect the two I received a" warning port
miss match".

//code:
//combination 2 half adder, not working

module FullAdder (sum, carry, a,b, carry_out);
input carry;
input a, b;
output carry, sum;
output carry_out;

HalfAdd low( a[a], b[sum1], sum[sum], carry_out[carry]);

HalfAdd hi ( a[1], b[1], sum[1], carry[1]);

or(carry_out, carry[0], carry[1]);

endmodule
Reply With Quote
  #2 (permalink)  
Old 10-24-2003, 12:28 AM
John_H
Guest
 
Posts: n/a
Default Re: newbie: connecting two half to one full adder using hierarchial model

So that we can help you, do you know much about
1) Module instantiation syntax, and
2) multi-bit wires and indicies
?
Your code as you have presented it makes little to no sense.
Also, just curious - does your professor want you to use the "or" primitive
instantiation rather than using a simple "assign?"


"slxrti" <[email protected]> wrote in message
news:[email protected] om...
> I would like to make a full adder from two half adder. I use a
> hierarchial
> model for the the full adder.
>
> How do I connect a output of one instance with a input of anther I
> tried declaring a wirer to connect the two I received a" warning port
> miss match".
>
> //code:
> //combination 2 half adder, not working
>
> module FullAdder (sum, carry, a,b, carry_out);
> input carry;
> input a, b;
> output carry, sum;
> output carry_out;
>
> HalfAdd low( a[a], b[sum1], sum[sum], carry_out[carry]);
>
> HalfAdd hi ( a[1], b[1], sum[1], carry[1]);
>
> or(carry_out, carry[0], carry[1]);
>
> endmodule



Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:02 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved