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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: Bryce Bardin Subject: Re: bitwise comparators Date: 2000/01/16 Message-ID: <3881328B.4146BF10@home.com>#1/1 X-Deja-AN: 573205549 Content-Transfer-Encoding: 7bit References: <3880D375.7E363123@hotmail.com> X-Accept-Language: en,en-GB,en-US,fr,fr-BE,fr-CA,fr-FR,fr-CH,de,de-AT,de-DE,de-CH,it,es,es-AR,es-CO,es-MX,es-ES Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@home.net X-Trace: news1.alsv1.occa.home.com 947991177 24.7.50.190 (Sat, 15 Jan 2000 18:52:57 PST) Organization: @Home Network MIME-Version: 1.0 NNTP-Posting-Date: Sat, 15 Jan 2000 18:52:57 PST Newsgroups: comp.lang.ada Date: 2000-01-16T00:00:00+00:00 List-Id: Alexander Van Hecke wrote: > > hello, > > I want to do the following : > OK_to_proceed : BOOLEAN := FALSE; > data : Unsigned_8; > > while (not OK_to_proceed) loop > -- do stuff > OK_to_proceed := (data BITWISE AND 2#1#); > end loop; > > so I want to exit the loop if bit one of data is set, but I don't know > what the bitwise and is! > > alex Data : Interfaces.Unsigned_8; Bit_0 : constant := 2**0; -- Clearer intent than 2#1# or 1 -- This might be given an application-specific name and -- (optionally) be given an explicit type, e.g.: Command_Accepted : constant Interfaces.Unsigned_8 := 2**0; -- Evaluated at compilation time. loop -- Do something that changes the value of Data. exit when (Data and Command_Accepted) = Command_Accepted; end loop;