CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

4 bit division

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
johnmarti42



Joined: 21 Jan 2018
Posts: 3

View user's profile Send private message

4 bit division
PostPosted: Wed Jan 31, 2018 9:19 pm     Reply with quote

I have to develop a 4 bit division, able to represent one integer (4 bits) and one decimal (4 bits).
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Thu Feb 01, 2018 1:37 am     Reply with quote

A decimal, is a 4bit integer. Just only uses 10 of the possible 16 values.

The same answer applies as for the post only a few days ago. Just use the +. However as was said in that thread, if you want to synthesise it to see the operation step by step, then you have a choice of synthesising using logic, or serial synthesis (bit by bit in sequence).
For the logic solution look at:
<https://stackoverflow.com/questions/14695051/how-to-simulate-a-4-bit-binary-adder-in-c>
This also starts to talk about the serial solution.
A discussion of this is here:
<https://www.safaribooksonline.com/library/view/introduction-to-digital/9780470900550/chap9-sec016.html>

The _real_ way to do this, is to draw the state table, and then show how you generate the required patterns using logic. This is how you would design a logic circuit for _any_ similar problem, and would be the solution you would be expected to actually show.

However this question is off topic. This is a group for questions about things to do with the CCS compiler. This is nothing to do with the CCS compiler. Mad
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group