Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.
This repository was archived by the owner on Jan 27, 2021. It is now read-only.

Understanding BitFieldExtraction Operator bfe[][] #84

@prpr2770

Description

@prpr2770

I'm trying to encode and decode information in the following data structure

instance packetload : bit_vector(16)
instance bv3 : bit_vector(3)

    object arbitload2 = {

        object brick = {
            type this = struct {
                brick1 : packetload,       
                brick2 : bv3
            }
            instance idx : unbounded_sequence
            instance arr : array(idx,this)
        }


        variant this of arbitload = struct {
        
            block1      : packetload,    
            block2      : brick.arr   
            
        }
}

And I believe i need to use the BFE-operator. I couldn't find proper documentation about this, and I was wondering if I could get some help in understanding it.

From the file language.md I obtained the following description:

 `bfe[3][0]` is the bit field extraction operator the takes the low order 4 bits of a bit vector.

Further in an earlier issue here
bfe[0][7](enc) was used. I'm confused about the indexing that's provided.

May I have a description of this operator, and how it needs to be used, to extract information from a byte of data?
Should the byte be defined as bit_vector(8) or can it be described by bv[8]?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions