Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- Community Forums
- :
- Forums
- :
- Hardware Development
- :
- AI Engine, DSP IP and Tools
- :
- Re: Ceil function using System generator 9.2 ??

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

pjayav

Observer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-25-2010 09:23 PM

5,105 Views

Registered:
11-11-2009

hi experts

Is there any block or logic to implement Ceil function using system generator blocks.

I am trying using Scale block. Shall i proceed exploring it or there are any easy logic is there to implement Ceil function using Xilinx system generator 9.2i.

regards

selvam

0
Kudos

Reply

1 Solution

Accepted Solutions

Highlighted

syoma

Adventurer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-26-2010 11:04 AM

5,536 Views

Registered:
08-20-2007

Yeah, sorry, forgot about this.

0
Kudos

Reply

5 Replies

Highlighted

syoma

Adventurer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-26-2010 12:17 AM

5,100 Views

Registered:
08-20-2007

If I understand right your logic, then ceiling is the same as flooring + 1. So far I remember flooring of two’s complement numbers is done by truncating the fraction part, both for positive and negative. At least it works for me.

So basically for flooring you don't need any logic, if you use "Convert" block with options Truncate and Wrap and binary point 0.

Then add 1 to result for ceiling.

0
Kudos

Reply

Highlighted

ywu

Xilinx Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-26-2010 09:28 AM

5,092 Views

Registered:
11-28-2007

To make it complete, you will need to test if the input is already an integer as floor and ceil of an integer have the same result.

syoma wrote:If I understand right your logic, then ceiling is the same as flooring + 1. So far I remember flooring of two’s complement numbers is done by truncating the fraction part, both for positive and negative. At least it works for me.

So basically for flooring you don't need any logic, if you use "Convert" block with options Truncate and Wrap and binary point 0.

Then add 1 to result for ceiling.

Cheers,

Jim

Jim

0
Kudos

Reply

Highlighted

syoma

Adventurer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-26-2010 11:04 AM

5,537 Views

Registered:
08-20-2007

Yeah, sorry, forgot about this.

0
Kudos

Reply

Highlighted

pjayav

Observer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-26-2010 11:04 PM

5,063 Views

Registered:
11-11-2009

Thank you jim and syoma. Your answers solved my problem

0
Kudos

Reply

Highlighted

goychman

Explorer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-25-2014 12:27 AM

2,493 Views

Registered:
11-03-2013

You can use this function for ceil, if your calculation is CEIL(Y/2) :

function integer ceil_of_half (integer x); begin if (x & 1) ceil_of_half = x/2 + 1; else ceil_of_half = x/2; end endfunction x = ceil_of_half(Z);

0
Kudos

Reply