From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ddd2479bb7fae4af X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: Bit manipulation Date: Mon, 7 Feb 2005 15:32:34 -0000 Organization: BAE SYSTEMS Message-ID: <42078883$1_1@baen1673807.greenlnk.net> References: <211db0ae.0502070437.54add641@posting.google.com> X-Trace: individual.net 870/kMg592s2IsVQ8IUwygsXxsSyfDMuMx6Dgd/NPAJPjVGgvd X-Orig-Path: baen1673807.greenlnk.net!baen1673807!not-for-mail X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Original-NNTP-Posting-Host: baen1673807.greenlnk.net Xref: g2news1.google.com comp.lang.ada:8181 Date: 2005-02-07T15:32:34+00:00 List-Id: Maurizio wrote: > hi, i need two hint: > > i need to acces to a 32 bit word (Interfaces.Unsigned_32). > how i can do to take the three m.s.bit? (30,31,32) As you would in 'C' - mask them, e.g. use type Interfaces.Unsigned_32; function Get_3_msb (I : Interfaces.Unsigned_32) return Interfaces.Unsigned_32 is begin return I and 16#E000_0000#; -- top 3 bits only end Get_3_msb; Cheers -- Martin