Saturday, July 11, 2020

#70 Activity Diagram for Login Create an activity diagram

ChemistryExplain is here for you to provide the important questions and answer “70 Activity Diagram for Login Create an activity diagram for simple login process” this question is coming from Computer Science.
#70 Activity Diagram for Login Create an activity diagram
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#70 A. Activity Diagram for Login Create an activity diagram for a simple login process. When you enter a name and password, the system checks to see if the unique pairing is correct. If it is, the system allows you to log in. If not, you're prompted to re-enter your information.

B. Activity Diagram for Course Registration System Creates an activity diagram for the class registration process for a client. This diagram uses notes to give more details about the initial and final states. After filling out the registration form, the client submits the form to a validation loop that is represented as a decision in the flow. If the information is correct, the system creates an account for the client and lets the client know about the creation of the account.

Answer


1a. Activity Diagram for Login.#70 Activity Diagram for Login Create an activity diagram b. Activity diagram for Course Registration System.#70 Activity Diagram for Login Create an activity diagram b. with details explained#70 Activity Diagram for Login Create an activity diagram


#70 Activity Diagram for Login Create an activity diagram

b. Activity diagram for Course Registration System.

#70 Activity Diagram for Login Create an activity diagram b. with details explained


#70 Activity Diagram for Login Create an activity diagram

Labels:

#69 Make a copy of the isothermal transformation diagram

ChemistryExplain is here for you to provide the important questions and answer “#69 Make a copy of the isothermal transformation diagram” this question is coming from Engineering.
#69 Make a copy of the isothermal transformation diagram
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#69 Make a copy of the isothermal transformation diagram for an iron–carbon alloy of eutectoid composition (Figure 10.22) and then sketch and label time–temperature paths on this diagram to produce the following microstructures:

(a) 100% coarse pearlite
(b) 50% martensite and 50% austenite
(c) 50% coarse pearlite, 25% bainite, and 25% martensite

Figure 10.22 The complete isothermal transformation diagram for an iron–carbon alloy of eutectoid composition: A, austenite; B, bainite; M, martensite; P, pearlite.

#69 Make a copy of the isothermal transformation diagram

Answer


Draw the isothermal transformation diagram for an iron-carbon alloy of eutectoid composition showing the given composition on it.

#69 Make a copy of the isothermal transformation diagram

Labels:

#68 The track for this racing event was designed

ChemistryExplain is here for you to provide the important questions and answer “#68 The track for this racing event was designed” this question is coming from Physics.
#68 The track for this racing event was designed
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#68 The track for this racing event was designed so that riders jump off the slope at 30^degree, from a height of 1 m. During a race, it was observed that the rider shown in Fig. 12-23_alpha remained in midair for 1.5 s. Determine the speed at which he was traveling off the slope, the horizontal distance he travels before striking the ground, and the maximum height he attains. Neglect the size of the bike and rider.
#68 The track for this racing event was designed

Answer


using 2nd equation of motion

h = ho + u sin x * t - 0.5 gt^2

0 = 1 + u * sin 30 * 1.5 - 4.9* 1.5^2

u = 13.367 m/s

=======

horizontal range

R = u cos x * t = 13.367* cos 30* 1.5 = 17.364 m

======

vertical max height

H = 1 + ( u sin x)^2/ 2g

H = 1 + 13.367^2 / ( 19.6)

H = 3.28 m

Labels:

#67 Construct a 3x3 matrix A, with nonzero entries

ChemistryExplain is here for you to provide the important questions and answer “#67 Construct a 3x3 matrix A, with nonzero entries” this question is coming from Math.
#67 Construct a 3x3 matrix A, with nonzero entries
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#67 Construct a 3x3 matrix A, with nonzero entries and a vector b in R3 such that b is not in the set spanned by the columns of A. Choose the correct answer below
#67 Construct a 3x3 matrix A, with nonzero entries

Answer

#67 Construct a 3x3 matrix A, with nonzero entries
#67 Construct a 3x3 matrix A, with nonzero entries

Labels:

#66 Find the solutions that can be read from the simplex

ChemistryExplain is here for you to provide the important questions and answer “#66 Find the solutions that can be read from the simplex tableau given below” this question is coming from Math.
#66 Find the solutions that can be read from the simplex
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#66 Find the solutions that can be read from the simplex tableau given below

Answer

#66 Find the solutions that can be read from the simplex


Labels:

Friday, July 10, 2020

#65 Differentiate the function. F(t) = 3 - 2/3t

ChemistryExplain is here for you to provide the important questions and answer “#65 Differentiate the function. F(t) = 3 - 2/3t” this question is coming from Math.
#65 Differentiate the function. F(t) = 3 - 2/3t
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#65 Differentiate the function.
#65 Differentiate the function. F(t) = 3 - 2/3t
#65 Differentiate the function. F(t) = 3 - 2/3t
#65 Differentiate the function. F(t) = 3 - 2/3t

Answer


1. f(t)=3-\frac{2}{3}t

{f}'(t)=0-\frac{2}{3}

=-2/3

2. f(x)= \frac{2}{5}x^{15}


{f}'(x)=\frac{2}{5}15x^{14}

=6x14

3. f(t)=   \frac{2}{3}t^{6}-2t^{4}+7t


{f}'(t)=\frac{2}{3}6t^{5}-2.4t^{3}+7

=4t5-8t3+7

Labels:

#64 Steam expands reversibly in a cylinder behind a piston

ChemistryExplain is here for you to provide the important questions and answer “#64 Steam expands reversibly in a cylinder behind a piston” this question is coming from Mechanical Engineering.
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#64 Steam expands reversibly in a cylinder behind a piston from 6 bar dry saturated, to a pressure of 0.65 bar. Assuming that the cylinder is perfectly thermally insulated, calculate the work done during the expansion per kilogram of steam.

Answer

#64 Steam expands reversibly in a cylinder behind a piston

Labels:

#63 Distinguish between Current/Short term Liabilities

ChemistryExplain is here for you to provide the important questions and answer “63 Distinguish between Current/Short term Liabilities” this question is coming from Accounting.

#63 Distinguish between CurrentShort term Liabilities

Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question

#63 Distinguish between Current/Short term Liabilities and Non-current/Long term Liabilities.

Illustrate your answer with journal entries as examples.

Answer

Liabilities are something that a company or a person owes especially money, services, etc. They represent the obligations of a company or a person.

Liabilities can be Short term- Current liabilities or Long term liabilities. Short-term liabilities are known as Current liabilities while long term liabilities are known as Non-current liabilities. Short term liabilities/Current liabilities are liabilities that are obligations or services that are owned by a company in the near future. Usually, short term liabilities are liabilities that occur within the next 1 year. Few examples of short term liabilities are:-

1.) A company purchased inventory on credit, to be paid within 3 months:-

ParticularsAmountAmount
Inventory A/cXXX
            To Accounts Payable A/cXXX
(to record the purchase of inventory on credit)

2.) Salaries payable that are due for 2 weeks to its employees

ParticularsAmountAmount
Salaries expense A/cXXX
            To Salaries Payable A/cXXX
(To record the salaries payable)

Long term liabilities are liabilities that are non-current and long term in nature. These are generally the liabilities that are expected to be paid by the company on a long term basis. They are generally due after one year. Long term liabilities include Loans, mortgages, bonds payable, Debentures, pension obligations, etc. The obligations are not immediate and hence they are classified as Long term liabilities. Few examples of long term liabilities include:-

1.) ABC company issued Bonds payable for cash of $1 million.

ParticularsAmountAmount
Cash A/cXXX
            To Bonds Payable A/cXXX
(To record the bonds payable)

2.) DEF company borrowed a loan of $5 million to finance its purchase of a new machine

ParticularsAmountAmount
Cash A/cXXX
            To Loan Payable A/cXXX
(To record the proceeds from a loan and its related liabilities)

Labels:

Thursday, July 9, 2020

#62 On Dec 31, 2019, XYZ Company sells a machine

ChemistryExplain is here for you to provide the important questions and answer “#62 On Dec 31, 2019, XYZ Company sells a machine that originally” this question is coming from Accounting.
#62 On Dec 31, 2019, XYZ Company sells a machine
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#62 On Dec 31, 2019, XYZ Company sells a machine that originally

On Dec 31, 2019, XYZ Company sells a machine that originally cost $150,000 for $90,000 cash. The machine was placed in service on January 1, 2015. It was depreciated using the straight-line method with an estimated salvage value of $25,000 and a useful life of 10 years. Determine the profit or loss made on disposal of the machine and pass Journal Entry. .(5 Marks) b. Depletion and Amortization are the processes of allocating the cost of a of different asset to expense in the accounting periods benefiting from its use. Explain the assets applicable for such processes.

Answer


#62 On Dec 31, 2019, XYZ Company sells a machine
Depletion is a gradual exhaustion of natural resource reserves to an expense account for extracting natural resources For example : Timber, minerals, and oil extraction from the earth.


Amortization is the allocation of the cost of intangibles over the useful life or legal life of the intangibles for example copyrights, patents, franchise rights, trademarks.

Labels:

#61 On 1st April 2008 Abdulla installs new machinery costing

ChemistryExplain is here for you to provide the important questions and answer “#61 On 1st April 2008 Abdulla installs new machinery costing” this question is coming from Accounting.
#61 On 1st April 2008 Abdulla installs new machinery costing
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#61 On 1st April 2008 Abdulla installs new machinery costing

On 1st April 2008, Abdulla installs new machinery costing SAR 312,000 with a five-year life and estimated salvage value of SAR28000. Management estimates that the machine will produce 1136000 units of the product during its lifetime. Actual units of production were as follows: 1st year 245600 units, 2nd year 230400 units, 3rd year 227000 units, 4th year 232600 units & 5th year 200400 units. Compute depreciation Expenses under the Straight-line method, Double declining balance method, and Units of Production Method method the machine must not be depreciated below its estimated salvage value.

Answer


A) Straight Line Method

Annual Depreciation by SLM = (312000-28000)/5

56,800

YearDepreciation Expense
156800
256800
356800
456800
556800

B) Calculation of depreciation by double declining balance method

SLM Depreciation Rate = 1 / 5 *100 = 20%.

Depreciation rate for Double Declining balance method = 20%*2 = 40%

YearOpening Carrying ValueDepreciation ExpenseCarrying Value312,000
1312,000124,800187,200
2187,20074,880112,320
3112,32044,92867,392
467,39226,95740,435
540,43512,43528,000

C)Unit of Production method

Depreciation per unit of production = (312000-28000)/1136000  = $0.25

YearUnits of ProductionDepreciation ExpenseCarrying Value272000
124560061400250600
223040057600193000
322700056750136250
42326005815078100
52004005010028000

Labels:

#60 Explain the methods that can estimate bad debt expenses

ChemistryExplain is here for you to provide the important questions and answer “#60 Explain the methods that can estimate bad debt expenses” this question is coming from Accounting.
#60 Explain the methods that can estimate bad debt expenses
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#60 Explain the methods that can estimate bad debt expenses

a) Explain the methods that can estimate bad debt expenses in business. (Give numerical examples)

b.) Differentiate between Accounts receivable and Notes receivable. (1 Mark)

c) On the 1st of October 2019, XYZ Inc. has sold equipment for $ 25,000 to ABC Ltd.by issuing an 8% note receivable for 90 days. Calculate the interest on the note and on what would be the maturity date. Pass Journal entry in the books of the company to record these transactions.

Answer

#60 Explain the methods that can estimate bad debt expenses

Labels:

#59 The Dornier is a light freighter and feeder liner aircraft powered

ChemistryExplain is here for you to provide the important questions and answer “#59 The Dornier is a light freighter and feeder liner aircraft powered” this question is coming from Mechanical Engineering.
#59 The Dornier is a light freighter and feeder liner aircraft powered
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#59 The Dornier is a light freighter and feeder liner aircraft powered

#59 The Dornier is a light freighter and feeder liner aircraft powered by two Lycoming IGSO-540- A1A six-cylinder horizontally opposed engines, each rated at 260 kW. Assume that the Otto cycle represent the cycle for such a spark-ignition engine. Data for the engine is as follows

Compression ratio: 8

Temperature and pressure at the beginning of the compression stroke: 300 K and 96 kPa

Rate of heat transfer during the constant volume stroke: 760 kJ/kg.

Specific heat at constant volume: 0.72 kJ/(kg · K)

Calculate

a) The pressure and temperature at the end of the heat addition process

 b) Network output

c) Air mass flow rate

d) Mean effective pressure

Answer
#59 The Dornier is a light freighter and feeder liner aircraft powered
#59 The Dornier is a light freighter and feeder liner aircraft powered

Labels:

#58 ABC purchased 100% of the shares of XYZ for $4,000,000

ChemistryExplain is here for you to provide the important questions and answer “#58 ABC purchased 100% of the shares of XYZ for $4,000,000” this question is coming from finance.
#58 ABC purchased 100% of the shares of XYZ for $4,000,000
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#58 ABC purchased 100% of the shares of XYZ for $4,000,000

#58 ABC purchased 100% of the shares of XYZ for $4,000,000

a) It is known that the fair value of XYZ total assets is $4,800,000. What is the fair value of XYZ's net assets? What is the value of DEF's goodwill?

b) Using push-down accounting, restate XYZ's financial statements to reflect the purchase price.

Answer


a)Fair value of Net assets= Fair value of total assets- Total liabilities

=4800000-1000000= 3800000

Steps to find goodwill on aquisition:

1.Get the book value of assets=4500000

2.Get the fair value of assets=4800000

3.Difference between fair value and book value(Fair value adjustments)=4800000-450000=300000

4.Calculate excess purchase price= Actual consideration paid- net book value of assets

Actual consideration paid=4000000

Net book value of assets= Book value of assets minus liabilities=4500000-1000000=3500000

Excess purchase price=4000000-3500000=500000

5.Calculate goodwill= Excess purchase price- Fair value adjustments

=500000-300000=200000

Labels:

Wednesday, July 1, 2020

#57 Solve the differential equation y^' − xy = e^x y(0) = 2

ChemistryExplain is here for you to provide the important questions and answer “#57 Solve the differential equation y^' − xy = e^x   y(0) = 2” this question is coming from Math.
#57 Solve the differential equation y^' − xy = e^x   y(0) = 2
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#57 Solve the differential equation

y^' − xy = e^x   y(0) = 2

Answer

#57 Solve the differential equation y^' − xy = e^x   y(0) = 2
#57 Solve the differential equation y^' − xy = e^x   y(0) = 2

Labels:

Tuesday, June 30, 2020

#52 Implement and test the following combinational

ChemistryExplain is here for you to provide the important questions and answer “#52 Implement and test the following combinational” this question is coming from Electrical Engineering.
#52 Implement and test the following combinational
Get the Free Online Chemistry Q&A Questions And Answers with explain. To crack any examinations and Interview tests these Chemistry Questions And Answers are very useful. Here we have uploaded the Free Online Chemistry Questions. Here we are also given the all chemistry topic.

ChemistryExplain team has covered all Topics related to inorganic, organic, physical chemistry, and others So, Prepare these Chemistry Questions and Answers with Explanation Pdf.

Question


#52 Implement and test the following combinational circuit using Verilog HDL.
Notes:

- The inputs (A, B) are 4-bits

- The output also is 4-bits

- The circuit will operate the output of the circa the circuit is) as following.
Procedure

- Implement the 1-bit binary adder/subtractor using structural Verilog HDL code.

- Use the created module of 1-bit binary adder/subtractor to build 4-bit adder/subtractor structurally, then using Quartus to create a symbol for it.

- Write the module of 1-digit BCD adder/subtractor, then using Quartus to create a symbol for it

- Write the code of MAX module, then using Quartus to create a symbol for it.

- Write the code of the MIN module, then using Quartus to create a symbol for it.
Procedure

- Implement the 1-bit binary adder/subtractor using structural Verilog HDL code.

- Use the created module of 1-bit binary adder/subtractor to build 4-bit adder/subtractor structurally, then using Quartus to create a symbol for it

- Write the module of 1-digit BCD adder/subtractor, then using Quartus to create a symbol for it

- Write the code of MAX module, then using Quartus to create a symbol for it.

- Write the code of the MIN module, then using Quartus to create a symbol for it.

- Write a Verilog HDL code to describe the module 4-bit 4x1 multiplexer, then using Quartus to create a symbol for it

- Test each module

- Use Quartus schematic to describe the whole system from its subsystems.

- Test the whole system

Project Report

The report document must contain sections highlighting the following

1 - Design and implementation 

- Specity clearly the design and implementation details of each components

- Provide drawings of the component circuits and the overall system

- Carry out the design and implementation with the following aspects in mind:

i Correctness of the individual components

ii Correctness of the overall design when wiring the components together

iii Completeness: all operation were implemented properly.

2 - Simulation and Testing 

- Carry out the simulation of each component.

- Carry out the simulation of the whole system

- Also provide snapshots of the Simulator window with your test cases and showing the simulation output results.

3- Teamwork 

- Two students can form a group

- Group members are required to coordinate the work equally among themselves so that everyone is involved in all the following activities

i Design and implementation

ii Simulation and Testing .

- Clearly show the work done by each group member

Submission Guidelines 

Attach one zip file containing all the design circuits, the pr programs source code Screenshot is not allowed in writing the code (copy the code from Quartus software) as well as the report document to Raj as a reply to this message.

Grading policy

The grade will be divided according to the following components: 

1. Correctness: whether your implementation is working

2. Completeness and testing whether all components and cases have been implemented, handled, and tested properly

3. Participation and contribution to the project

4. Report document

Answer


module adder_subtractor(S, C, V, A, B, Op);

   output [3:0] S;

   output           C,V;  

   input [3:0] A,B;

   input             Op; // The operation: 0 => Add, 1=>Subtract.

   wire C0, C1, C2, C3;

   wire B0, B1, B2, B3;

   xor(B0, B[0], Op);

   xor(B1, B[1], Op);

   xor(B2, B[2], Op);

   xor(B3, B[3], Op);

   xor(C, C3, Op);  

   xor(V, C3, C2); 

   full_adder fa0(S[0], C0, A[0], B0, Op); 

   full_adder fa1(S[1], C1, A[1], B1, C0);

   full_adder fa2(S[2], C2, A[2], B2, C1);

   full_adder fa3(S[3], C3, A[3], B3, C2); 

endmodule

module full_adder(S, Cout, A, B, Cin);

   output S, Cout;

      input A,B, Cin;

       wire   w1,w2,w3,w4;

xor(w1, A, B);

   xor(S, Cin, w1);

   and(w2, A, B);

   and(w3, A, Cin);

   and(w4, B, Cin);

   or(Cout, w2, w3, w4);

endmodule

module max(input [3:0]A, input [3:0]B, output [3:0]out3);
reg [3:0]max;

always @(*)

begin
if((A)>B)
max=A;
else
max=B;
end
assign out3=max;`
endmodule

module min(input [3:0]A, input [3:0]B, output [3:0]out4);
reg [3:0]min;

always @(*)

begin
if((A)>B)
min=B;
else
min=A;
end
assign out4=min;`
endmodule

module mux4_1( a, b, c, d, s0, s1, out);

input wire a, b, c, d;

input wire s0, s1;

output reg out;

always @ (a or b or c or d or s0, s1)

begin

case (s0 | s1)

2'b00 : out <= a;

2'b01 : out <= b;

2'b10 : out <= c;

2'b11 : out <= d;

endcase

end

endmodule

module bcd(a,b,carry_in,sum,carry,op);

    input [3:0] a,b;

    input carry_in,op;

    output [3:0] sum;

    output carry;

        reg [4:0] sum_temp;

    reg [3:0] sum;

    reg carry;

always @(a,b,carry_in,op)

    begin

        sum_temp = a+b+carry_in;

        if(sum_temp > 9)

begin

            sum_temp = sum_temp+6;

            carry = 1;

            sum = sum_temp[3:0];

    end

        else

begin

            carry = 0;

            sum = sum_temp[3:0];

        end

    end  

endmodule

Labels: