Constructeur Données membres, l’interface Nom du module half_adder.h // File : half_adder.h #include "systemc.h" SC_MODULE(half_adder) { sc_in a,b; sc_out.

Slides:



Advertisements
Similar presentations
Digital System Design Subject Name : Digital System Design Course Code : IT-314.
Advertisements

1 Polymorphisme. 2 // Polymorphisme: illustre le polymorphisme et Vector import java.util.*; public class TestPolymorphisme { public static void main.
Operator overloading redefine the operations of operators
Color Templates Software Engineering Module: Core of Java Topic: Constructors TALENTSPRINT | © Copyright 2012.
UE SYSTEMC – Cours 2 Etude et modélisation dun processeur en SystemC
HM-ES-th1 Les 7 Hardware/Software Codesign with SystemC.
One Bit Full Adder One Bit Full Adder A bit B bit Sum bit C in C out
Topics Adders Half Adder Full Adder Subtracter Half Subtracter
ADDER, HALF ADDER & FULL ADDER
Adders Module M8.1 Section 6.2. Adders Half Adder Full Adder TTL Adder.
Kuliah Rangkaian Digital Kuliah 7: Unit Aritmatika
Conversion and Coding (12)10.
//HDL Example 4-10 // //Gate-level description of circuit of Fig. 4-2 module analysis (A,B,C,F1,F2); input.
The Verilog Hardware Description Language
Winter-Spring 2001Codesign of Embedded Systems1 Introduction to SystemC Part of HW/SW Codesign of Embedded Systems Course (CE )
Full Adder Section 4.5 Spring, 2014 J.Ou. Schedule 62/3MondayBinary addition: full adder 72/5WednesdayBinary addition: full adder/four-bit adder L2/6ThursdayLab.
Chapter 1 : SystemC Overview. What is SystemC Systemc is a modeling platform  A set C++ class library to add hardware modeling constructs  Simulation.
Binary Addition. Binary Addition (1) Binary Addition (2)
Half Adder ( / ) Structural description: Data flow description:
Gate-level Design: Full Adder  Truth table: Note: Z - carry in (to the current position) C - carry out (to the next position)  Using K-map, simplified.
CS 140 Lecture 14 Professor CK Cheng 11/14/02. Part II. Standard Modules A.Interconnect B.Operators. Adders Multiplier Adders1. Representation of numbers.
Lecture 1: Introduction to Digital Logic Design CK Cheng Tuesday 4/1/02.
Combinational circuits
CS 140 Lecture 19 Professor CK Cheng 12/05/02. Sequential Machine Standard Modules Combinational Sequential System Designs.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
 Arithmetic circuit  Addition  Subtraction  Division  Multiplication.
XOR, XNOR, and Binary Adders
Binary Addition Section 4.5. Binary Addition Example.
ECE 3130 – Digital Electronics and Design
ADDERS Half Adders Recall that the basic rules of binary addition are as indicated below in Table 2-9. A circuit known as the half-adder carries out these.
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
FPGA-Based System Design: Chapter 4 Copyright  2004 Prentice Hall PTR Topics n Multipliers.
Basic Addition Review Basic Adders and the Carry Problem
Carry look ahead adder P (I) = a(I) xor b(I); G(I) = a(I) and b(I); S(I) = p(I) xor c(I); Carry(I+1) = c(I)p(I) + g(I)
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Lecture 11, Advance Digital Design
Half-Adder: A combinational circuit which adds two one-bit binary numbers is called a half-adder. The sum column resembles like an output of the XOR gate.
Number Systems and Circuits for Addition Lecture 5 Section 1.5 Thu, Jan 26, 2006.
Universal college of engineering & technology. .By Harsh Patel)
1 Ethics of Computing MONT 113G, Spring 2012 Session 5 Binary Addition.
Logic and computers 2/6/12. Binary Arithmetic /6/ Only two digits: the bits 0 and 1 (Think: 0 = F, 1.
Sneha.  A combinational circuit that performs the addition of two bits is called a half adder.  It has two inputs.  It has two outputs.
Digital Logic Design (CSNB163)
Number Systems and Circuits for Addition – Binary Adders Lecture 6 Section 1.5 Fri, Jan 26, 2007.
CONSECUTIVE INTEGERS. CONSECUTIVE INTEGERS - Consecutive integers are integers that follow each other in order. They have a difference of 1 between each.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Basic Addition Review Basic Adders and the Carry Problem Carry Propagation Speedup Speed/Cost Tradeoffs Two-operand Versus Multi-operand Adders.
Addition Flashcards Sum of
ECEN 248 Lab 3: Study and Implementation of Adders Dept. of Electrical and Computer Engineering.
The George Washington University School of Engineering and Applied Science Department of Electrical and Computer Engineering ECE122 – Lab2 Adders & Multiplexers.
Half-Adder:  A combinational circuit which adds two one-bit binary numbers is called a half-adder. oThe sum column resembles like an output of the XOR.
ECE 3130 Digital Electronics and Design
Combinational Circuits
Gate-level Design: Full Adder
Summary Half-Adder Basic rules of binary addition are performed by a half adder, which has two binary inputs (A and B) and two binary outputs (Carry out.
تحليل الحساسية Sensitive Analysis.
FIGURE 4.1 Block diagram of combinational circuit
بعض النقاط التي تؤخذ في الحسبان عند تقييم الاستثمارات الزراعية
ECE 301 – Digital Electronics
Number Systems and Circuits for Addition
SystemC Tutorial.
Chapter 5 -Part 3.
DIGITAL ELECTRONICS B.SC FY
Geometry 2 Level 1.
Electronics for Physicists
XOR Function Logic Symbol  Description  Truth Table 
Today’s Lab Start working with Xilinx
Chapter 1 : SystemC Overview
Four Bit Adder Sum A Cin B Cout 10/9/2007 DSD,USIT,GGSIPU.
Presentation transcript:

Constructeur Données membres, l’interface Nom du module half_adder.h // File : half_adder.h #include "systemc.h" SC_MODULE(half_adder) { sc_in a,b; sc_out sum,carry; void prc_half_adder(); SC_CTOR(half_adder) { SC_METHOD(prc_half_adder); sensitive << a << b; } }; half_adder.h

SC_METHOD (1) // File : half_adder.h #include "systemc.h" SC_MODULE(half_adder) { sc_in a,b; sc_out sum,carry; void prc_half_adder(); SC_CTOR(half_adder) { SC_METHOD(prc_half_adder); sensitive << a << b; } }; Déclare un process sans mémoire appelé prc_half_adder() Ne peut utiliser les wait Sensibilité « statique » sur a et b

SC_METHOD (2) // File : half_adder.cpp #include "half_adder.h" void half_adder::prc_half_adder() { sum = a ^ b; carry = a & b; }

Description de la hiérarchie // File : full_adder.h #include "half_adder.h" SC_MODULE(full_adder) { sc_in a,b,carry_in; sc_out sum,carry_out; sc_signal c1,s1,c2; void prc_or(); half_adder *ha1_ptr,*ha2_ptr; SC_CTOR(full_adder) { ha1_ptr=new half_adder("ha1"); // Named association: ha1_ptr->a(a); ha1_ptr->b(b); ha1_ptr->sum(s1); ha1_ptr->carry(c1); ha2_ptr=new half_adder("ha2"); // Positional association: (*ha2_ptr)(s1,carry_in,sum,c2); SC_METHOD(prc_or); sensitive << c1 << c2; } // A destructor ~full_adder() { delete ha1_ptr; delete ha2_ptr; } }; // File : full_adder.cpp #include "full_adder.h" void full_adder::prc_or() { carry_out = c1 | c2; }

driver.h, driver.cpp // File : driver.h #include "systemc.h" SC_MODULE(driver) { sc_out d_a,d_b,d_cin; void prc_driver(); SC_CTOR(driver) { SC_THREAD(prc_driver); } }; // File : driver.cpp #include "driver.h" void driver::prc_driver() { sc_uint pattern; pattern=0; while (1) { d_a=pattern[0]; d_b=pattern[1]; d_cin=pattern[2]; wait(5,SC_NS); pattern++; }

monitor.h, monitor.cpp // File : monitor.h #include "systemc.h" SC_MODULE(monitor) { sc_in m_a,m_b,m_cin,m_sum,m_cout; void prc_monitor(); SC_CTOR(monitor) { SC_METHOD(prc_monitor); sensitive << m_a << m_b << m_cin << m_sum << m_cout; } }; // File : monitor.cpp #include "monitor.h" void monitor::prc_monitor() { cout << "At time " << sc_time_stamp() << "::"; cout << "(a, b, carry_in): "; cout << m_a << m_b << m_cin; cout << " (sum, carry_out): " << m_sum << m_cout << endl; }

Comparaison VHDL-SystemC // File : half_adder.h #include "systemc.h" SC_MODULE(half_adder) { sc_in a,b; sc_out sum,carry; void prc_half_adder(); SC_CTOR(half_adder) { SC_METHOD(prc_half_adder); sensitive << a << b; } }; // File : half_adder.cpp #include "half_adder.h" void half_adder::prc_half_adder() { sum = a ^ b; carry = a & b; } ARCHITECTURE half_adder_d OF half_adder IS BEGIN sum <= (a XOR b); carry <= (a AND b); END half_adder_d; ENTITY half_adder IS PORT( a, b: IN BIT; sum, carry: OUT BIT); END half_adder;