COMPUTER SYSTEM AND METHOD FOR PERFORMING RANDOM ACCESS OF A BIT IN A MEMORY
The integration of a dedicated circuit in the digital signal processing processor allows for efficient random access and manipulation of bits within a byte array, addressing the inefficiencies of traditional software-based methods by reducing execution cycles and power consumption.
Patent Information
- Application Number
- FR2023014482
- Authority / Receiving Office
- FR · FR
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-20
AI Technical Summary
Existing computer systems face inefficiencies in accessing and manipulating individual bits within a byte array in memory, particularly due to the need for multiple cycles and high energy consumption when using software-based methods.
A computer system equipped with a dedicated circuit integrated into the digital signal processing processor, utilizing a bit position pointer to directly access and manipulate bits within a byte array, reducing the need for software-based masking and shifting operations.
This solution enables faster and more energy-efficient random access to bits in memory, significantly reducing the number of execution cycles and power consumption compared to traditional software-based methods.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Title of the invention: COMPUTER SYSTEM AND METHOD FOR PERFORMING RANDOM ACCESS TO A BIT IN A MEMORY
[0001] Embodiments and implementations relate to randomly reading and writing a bit in a data memory of a computer system.
[0002] A computer system may comprise a data memory configured to store a byte array and a central processing unit configured to access in reading and / or writing to this data memory in order to read or write words in said byte array.
[0003] The central processing unit is generally configured to access the data memory in read and / or write mode in order to read 8-bit, 16-bit or 32-bit words.
[0004] There are certain applications requiring random reading and / or writing of a bit in a byte array stored in a data memory of a computer system. Random reading and / or writing is when the reading and / or writing are performed at unpredictable times. The read and / or write accesses may in particular be performed to read and / or write each bit of the byte array. For example, a known application requiring random reading or writing of a bit in a data memory is the coding and decoding of an audio signal.
[0005] In these applications, 8-bit, 16-bit or 32-bit memory accesses do not allow a bit to be directly read or written into the data memory.
[0006] In order to access a single bit in the byte array of the data memory, it is common to access the byte of said byte array comprising the bit to be accessed and then to use a mask associated with the position of the bit to be accessed in said byte in order to select the bit in said byte. This access to the bit is carried out by software by the central processing unit.
[0007] Such a method requires performing several tests and updates to access a single bit. In particular, the mask must be updated for each bit to be accessed. These tests and updates executed by software may require several cycles of the central processing unit. Thus, such access to said bit is relatively long to perform. In addition, such access to said bit consumes a relatively large amount of energy due to the numerous cycles of the central processing unit required. However, for certain applications, in particular for Bluetooth low energy (also designated by the acronym “BLE”), it is important to minimize energy consumption and the number of calculations to perform a given task.
[0008] There is therefore a need to propose a solution allowing simpler and faster access to a bit in a byte array.
[0009] According to one aspect, there is provided a computer system comprising: - a data memory configured to store a byte array, and a program memory configured to store a computer program, - a digital signal processing processor configured to execute a computer program comprising instructions for accessing a bit in said byte array, said digital signal processing processor being configured to access each byte of said byte array, - a dedicated circuit - in particular integrated in the digital signal processing processor - configured to access in reading and / or writing a bit of a byte of said byte table using: • a bit position pointer pointing to the bit to be accessed in the byte array, and • said byte comprising the bit to be accessed.
[0010] Such a computer system simply uses a bit position pointer, not a byte position pointer taken in combination with a mask.
[0011] Such a computer system is configured to access a bit in memory randomly by using a dedicated circuit to carry out certain instructions. This dedicated circuit occupies little space in the computer system and significantly improves the delay in accessing a bit in memory.
[0012] Such a computer system is configured to simply and quickly access a bit in the memory randomly. Indeed, such a dedicated circuit requires few execution cycles of the digital signal processing processor to access a bit in the memory randomly.
[0013] Such a dedicated circuit also makes it possible to reduce the energy consumption for accessing a bit in the memory randomly, because such access is achieved by performing few operations and in few cycles.
[0014] In an advantageous embodiment, the dedicated circuit comprises a first block configured to calculate a byte offset value according to the value of the bit position pointer.
[0015] Advantageously, the first block of the dedicated circuit comprises: - an “AND” type logic gate configured to perform an “AND” type logic operation between the value of the bit position pointer and the hexadecimal value 0x7 to obtain an indexing value, - a comparison circuit configured to calculate the byte offset value by comparing the index value to 0, the byte offset value being equal to -1 when the index value is equal to 0 and equal to 0 otherwise.
[0016] In an advantageous embodiment, the dedicated circuit comprises a second block configured to determine the value of a bit to be read from the bit position pointer and a byte comprising said bit to be read.
[0017] Advantageously, the second block of the dedicated circuit comprises: - an adder circuit configured to increase the value of the bit position pointer by 1, - a first “AND” type logic gate configured to perform an “AND” type logic operation between the increased value of the bit position pointer and a hexadecimal value equal to 0x7, - a subtractor circuit configured to calculate an offset value by subtracting a value equal to 7 from the output value of the first “AND” type logic gate, - a shift circuit configured to shift to the right the value of the byte comprising said bit to be accessed by a number of bits corresponding to said offset value, - a second “AND” type logic gate configured to perform an “AND” type logic operation between a value equal to 1 and the value of the shifted byte so as to obtain the value of the bit to be read.
[0018] The dedicated circuit uses two blocks for reading a bit in the byte array. In particular, all the tests for reading a bit are performed by the dedicated circuit, and not by a central processing unit of the computer system. In this way, random read access of a bit in the byte array of the data memory is performed more quickly.
[0019] In an advantageous embodiment, the computer program comprises instructions which, when implemented by the digital signal processing processor, cause the latter to make at least one call to a function to read a bit in the byte array, each call to this function taking as input the bit position pointer and a byte pointer as attributes and resulting in: - a calculation of a byte offset value by said first block, then - an update of the byte pointer by said byte offset value, then - a determination of the value of the bit to be read by said second block of the dedicated circuit.
[0020] To program such a reading of a bit in the byte array of said data memory, it is possible to use intrinsic functions which allow the use of said dedicated circuit. An intrinsic function is integrated into a compiler. This makes it possible to simplify the programming of such random access to a bit in the data memory.
[0021] Advantageously, the dedicated circuit comprises a third block configured to write the value of a bit in place of a bit pointed to by the bit position pointer in a byte to be written to.
[0022] In an advantageous embodiment, the third block of the dedicated circuit comprises:
[0023] - an adder circuit configured to increase the value of the position pointer bit 1,
[0024] - a first logic gate of type “AND” configured to perform an operation logical "AND" between the increased value of the bit position pointer and a hexadecimal value equal to 0x7,
[0025] - a subtractor circuit configured to calculate an offset value in subtracting a value equal to 7 from the output value of the first “AND” type logic gate,
[0026] - a shift circuit configured to shift left the value 1 by a number of bits corresponding to said offset value to create a mask,
[0027] - an inverting logic gate configured to create a complementary mask to from said mask obtained at the output of the shift circuit,
[0028] - a second “AND” type logic circuit configured to apply the mask complementary on the byte to be written to obtain a first byte B0,
[0029] - an “OR” type logic circuit configured to apply the mask to the byte on which one to write to get a second byte.
[0030] - a selection circuit configured to generate a byte corresponding to the first byte if the value of the bit to be written is equal to 1 or corresponding to the second byte otherwise.
[0031] Preferably, the computer program comprises instructions which when implemented by the digital signal processing processor cause the latter to make at least one call to a function to write a bit into the byte array, each call to this function taking as input the bit position pointer and a byte pointer as attributes and resulting in:
[0032] - a calculation of a byte offset value by said first block, then
[0033] - an update of the byte pointer by said byte offset value, then
[0034] - a writing of the bit to be written by said third block of the dedicated circuit.
[0035] To program such writing of a bit in the byte table of said data memory, it is also possible to use intrinsic functions which allow the use of said dedicated circuit.
[0036] Preferably, the computer program comprises instructions which when implemented by the digital signal processor cause the latter to initialize the bit position pointer to point to the position of the last bit of the byte array, and to decrement said bit position pointer on each read and / or write access.
[0037] According to another aspect, there is provided a method, implemented by a computer system, for accessing in reading and / or writing to a bit of a byte stored in a byte table in a data memory of said computer system, the method comprising an implementation of instructions of the computer program by a digital signal processing processor of the computer system resulting in: - access to said byte stored in the data memory by the digital signal processing processor, - an implementation of a dedicated circuit of the computer system - in particular integrated in the digital signal processing processor - for accessing in reading and / or writing to said bit of the byte accessed by the digital signal processing processor using: • a bit position pointer pointing to the bit to be accessed in the byte array, and • said byte comprising the bit to be accessed.
[0038] In an advantageous embodiment, the method comprises an implementation of a first block of the dedicated circuit for calculating a byte offset value according to the value of the bit position pointer.
[0039] Advantageously, the implementation of the first block of the dedicated circuit results in: - an implementation of an "AND" type logic gate of the first block to perform an "AND" type logic operation between the value of the bit position pointer and the hexadecimal value 0x7 to obtain an indexing value, - an implementation of a comparison circuit of the first block to calculate the byte shift value by comparing the indexing value to 0, the byte shift value being equal to -1 when the indexing value is equal to 0 and equal to 0 otherwise.
[0040] In an advantageous embodiment, the method further comprises an implementation of a second block of the dedicated circuit for determining the value of a bit to be read from the bit position pointer and a byte comprising said bit to be read.
[0041] Advantageously, the implementation of the second block of the dedicated circuit results in: - an implementation of an adder circuit of the second block to increase the value of the bit position pointer by 1, - an implementation of a first logic gate of the “AND” type of the second block to perform a logic operation of the “AND” type between the increased value of the bit position pointer and a hexadecimal value equal to 0x7, - an implementation of a subtractor circuit of the second block to calculate an offset value by subtracting a value equal to 7 from the output value of the first “AND” type logic gate, - an implementation of a shift circuit of the second block to shift to the right the value of the byte comprising said bit to be accessed by a number of bits corresponding to said shift value, - an implementation of a second “AND” type logic gate of the second block to perform an “AND” type logic operation between a value equal to 1 and the value of the shifted byte so as to obtain the value of the bit to be read.
[0042] In an advantageous embodiment, the method comprises an implementation of instructions of the computer program by the digital signal processing processor causing at least one call of a function to read a bit in the byte array, each call of this function taking as input the bit position pointer and a byte pointer as attributes and causing: - a calculation of a byte offset value by said first block, then - an update of the byte pointer by said byte offset value, then - a determination of the value of the bit to be read by said second block of the dedicated circuit.
[0043] Advantageously, the method further comprising an implementation of a third block of the dedicated circuit for writing the value of a bit in place of a bit pointed to by the bit position pointer in a byte to be written to.
[0044] In an advantageous embodiment, the implementation of the third block of the dedicated circuit results in:
[0045] - an implementation of an adder circuit of the third block to increase the bit position pointer value of 1,
[0046] - an implementation of a first logic gate of the “AND” type of the third block to perform a logical operation of type "AND" between the increased value of the bit position pointer and a hexadecimal value equal to 0x7,
[0047] - an implementation of a subtractor circuit of the third block to calculate a offset value by subtracting a value equal to 7 from the output value of the first “AND” type logic gate,
[0048] - an implementation of a third block shift circuit to shift to the left the value 1 of a number of bits corresponding to said offset value to create a mask,
[0049] - an implementation of an inverting logic gate of the third block to create a complementary mask from said mask obtained by implementing the shift circuit,
[0050] - an implementation of a second “AND” type logic circuit of the third block to apply the complementary mask on the byte to be written to obtain a first byte,
[0051] - an implementation of an “OR” type logic circuit of the third block for apply the mask to the byte to be written to to obtain a second byte.
[0052] - an implementation of a selection circuit to generate a BTE_OUT byte corresponding to the first byte if the value of the bit to be written is equal to 0 or corresponding to the second byte otherwise.
[0053] Preferably, comprising an implementation of instructions of the computer program by the digital signal processing processor resulting in at least one call of a function to write a bit into the byte array, each call of this function taking as input the bit position pointer and a byte pointer as attributes and resulting in:
[0054] - a calculation of a byte offset value by said first block, then
[0055] - an update of the byte pointer by said byte offset value, then - writing of the bit to be written by said third block of the dedicated circuit.
[0056] Advantageously, the method comprises an implementation of instructions of the computer program by the digital signal processor causing an initialization of the bit position pointer to point to the position of the last bit of the byte array, and a decrement of said bit position pointer on each read and / or write access.
[0057] Other advantages and characteristics of the invention will appear on examining the detailed description of embodiments, which are in no way limiting, and the appended drawings in which:
[0058] [Fig.l]
[0059] [Fig.2]
[0060] [Fig.3]
[0061] [Fig.4]
[0062] [Fig.5]
[0063] [Fig.6] illustrate embodiments and implementations of the invention.
[0064] [Fig.l] illustrates an embodiment of a computer system SYS. The SYS computer system includes a central processing unit CPU and a central memory MMEM. The computer system also includes a digital signal processor DSP (also referred to as "Digital signal processor") with a data memory MEM, a program memory MEMP and a HWC circuit dedicated to read and / or write access to a bit in a byte. The latter is integrated in an arithmetic and logic unit ALU (also referred to as "Arithmetic and Logic Unit") of the digital signal processing processor (DSP). The digital signal processing processor (DSP) also contains a control unit (CU), an address generation unit (AGU) and a register bank (also referred to as "Register file"). The computer system SYS can be a system on a chip.
[0065] The data memory MEM is configured to store a byte array BTAB. The memory MEM can be accessed for reading or writing by the digital signal processing processor DSP. Each access to the memory by the digital signal processing processor DSP is performed for words having a minimum size of one byte. Thus, the digital signal processing processor DSP can access each byte of the byte array BTAB of the memory MEM. The digital signal processing processor DSP can place the loaded bytes in its registers which serve as buffers between the data memory MEM and the ALU of the digital signal processing processor DSP. However, the digital signal processing processor DSP cannot directly read or write a bit in said byte array.
[0066] The data in the byte array BTAB may correspond to compressed data of an audio data stream. In particular, the audio data stream comprises a succession of audio samples. These samples may be compressed in order to reduce their size. For example, the samples may be independently compressed to one bit, two bits, three bits or four bits. Each bit of the audio data stream may have its own meaning. The value of each bit of the data stream may influence the action to be taken in the decompression process for example. This is why it is important to be able to access a bit of the compressed audio data stream. It is therefore important to be able to access each bit of the byte array stored in memory.
[0067] The digital signal processing processor DSP is configured to execute a computer program PRG comprising instructions which, when implemented in the digital signal processing processor DSP, cause the latter to perform a read and / or write access to a bit of a byte of the byte array stored in memory. This computer program PRG can be stored in the program memory MEMP of the computer system SYS.
[0068] The digital signal processing processor DSP can allocate a first register RI to store a byte BTE_IN read from the byte array BTAB stored in the memory MEM. The digital signal processing processor DSP can also allocate a second register R2 to store a pointer BITP of the position of the bit to be accessed in the byte array BTAB. The digital signal processing processor DSP can also allocate a third register R3 to store a OFFST byte offset value. The DSP can also allocate a fourth register R4 to store a value of the bit to be accessed BIT_OUT. To write a bit, the DSP uses register R4 to store the bit BIT_IN to be written to the byte BTE_IN contained in the register RI. It reuses the register RI to store the resulting byte BTE_OUT with said bit written to the output.
[0069] The HWC circuit can in particular be obtained from an “RTL” (Register Transfer Level) code.
[0070] The dedicated HWC circuit includes a first NXTBBW block configured to determine the next value of the byte offset OFFST. Such a first NXTBBW block is illustrated in [Fig.2].
[0071] In particular, the first block NXTBBW is configured to receive as input the value of the bit position pointer BITP stored in the second register R2.
[0072] This first NXTBBW block comprises an AND1 logic gate of the “AND” type. The AND1 logic gate is configured to receive as input the value of the BITP bit position pointer as well as a value mask '0x7' (in hexadecimal). The “AND” type logic gate is configured to apply the value mask '0x7' to the value of the BITP bit position pointer. The “AND” type logic gate thus makes it possible to know from the three least significant bits of the BITP bit position pointer whether or not to pre-adjust the byte pointer via the OFFST byte offset.
[0073] The logic gate AND1 is configured to generate an indexing value INDX as output. In particular, the indexing value INDX on a byte is between 0 and 7. Thus, it is sufficient to look at the three least significant bits of the bit position pointer to know the indexing value INDX.
[0074] The first block NXTBBW also includes a comparison circuit CMPC taking as input the indexing value INDX. The comparison circuit CMPC makes it possible to check whether the indexing value is 0. If the indexing value is 0, this means that there is only one bit of the byte left to read because the others have already been read previously. In this case, it is necessary to modify the byte offset value to process the next byte in the byte array after reading the last bit of the current byte.
[0075] In particular, the CMPC comparison circuit also takes as input two parameters of value '-1' and '0'.
[0076] Thus, the comparison circuit CMPC is configured to compare the indexing value INDX to the value '0' and to generate the next value of the byte offset according to the result of this comparison. In particular, the comparison circuit CMPC is configured to generate a next value of the byte offset OFFST at '-1' when the indexing value is equal to '0', and at '0' when the value indexing value is different from '0'. This next value of the byte offset OFFST is then stored in the third register R3.
[0077] The first block NXTBBW is then configured to determine the byte offset value OFFST in a single cycle in the digital signal processing processor DSP.
[0078] The dedicated circuit HWC comprises a second READBIT block configured to determine the BIT_OUT value of a given bit in a BTE_IN byte. Such a second READBIT block is illustrated in [Fig.3]. The second READBIT block is configured to receive as input the BITP value of the bit position pointer stored in the second register R2 as well as the BTE_IN byte stored in the first register RL
[0079] The second block READBIT comprises an adder circuit ADD1 configured to receive as input the value of the bit position pointer BITP as well as a value equal to '1'. The adder circuit ADD1 is thus configured to add '1' to the value of the bit position pointer BITP.
[0080] The second READBIT block also comprises a first AND2 logic gate of type "AND" configured to receive as input the value of the bit position pointer BITP increased by '1' and a value mask '0x7' in hexadecimal.
[0081] The second READBIT block also comprises a subtractor circuit SUBI configured to receive as input a value equal to '7' and the value generated at the output of the logic gate AND2. This subtractor circuit SUB1 is configured to generate a value SL corresponding to the difference between the value '7' and the value generated at the output of the logic gate AND2.
[0082] The SL value is therefore calculated by the following formula = 7-(BITP+1) & 0x7-
[0083] The second READBIT block also includes a shift register SFT1 configured to receive the BTE_IN byte stored in the first RI register and to shift this BTE_IN byte to the right by a number of bits corresponding to the SL value.
[0084] The second READBIT block also comprises a second AND3 logic gate of the “AND” type configured to receive as input a value equal to '1' and the shifted byte generated as output from the shift register SFT1. This AND3 logic gate thus makes it possible to generate as output the BIT_OUT value of the lowest bit of the shifted byte. This value corresponds to the value of the bit of the BTE_IN byte stored in the first register located at the position pointed to by the bit position pointer BITP. This BIT_OUT value of the bit of the BTE_IN byte is then stored in the fourth register R4.
[0085] Thus, the second READBIT block makes it possible to determine the BIT_OUT value of the bit of the BTE_IN byte stored in the first RI register located at the pointed position. by the bit position pointer BITP. In particular, the second READBIT block is configured to determine the BIT_OUT value in a single cycle of the digital signal processing processor DSP.
[0086] The third WRITEBIT block is configured to write a BIT_IN bit to a BITP position in a BTE_IN byte stored in the first RI register. Such a third WRITEBIT block is illustrated in [Fig.5].
[0087] The third WRITEBIT block is configured to receive as input the value of the bit BIT_IN stored in the fourth register R4, the value BITP of the bit position pointer stored in the second register R2 as well as the byte BTE_IN stored in the first register RL
[0088] The third block WRITEBIT comprises an adder circuit ADD1 configured to receive as input the value of the bit position pointer BITP as well as a value equal to '1'. The adder circuit ADD1 is thus configured to add '1' to the value of the bit position pointer BITP.
[0089] The third WRITEBIT block also includes a first AND2 logic gate of type "AND" configured to receive as input the value of the bit position pointer BITP increased by '1' and a value mask '0x7' in hexadecimal.
[0090] The third block WRITEBIT also comprises a subtractor circuit SUB1 configured to receive as input a value equal to '7' and the value generated at the output of the logic gate AND2. This subtractor circuit SUB 1 is configured to generate a value SL corresponding to the difference between the value '7' and the value generated at the output of the logic gate AND2.
[0091] The SL value is therefore calculated by the following formula = 7-(BITP+1) & 0x7-
[0092] The third WRITEBIT block also includes a shift register SFT2 configured to calculate an MSK mask. This MSK mask is used to insert the input bit BIT_IN into the BTE_IN byte. In particular, the shift register SFT2 is configured to shift the value 1 to the left by a number of bits corresponding to the SL value to obtain the MSK mask.
[0093] The third WRITEBIT block further comprises an inverting gate NOT1 configured to invert the mask MSK so as to obtain a complementary mask INVMSK.
[0094] The third WRITEBIT block also includes a second AND4 logic gate of the “AND” type configured to apply the complementary mask INVMSK to the BTE_IN byte. This AND4 logic gate thus makes it possible to generate a first B0 byte at the output.
[0095] The third WRITEBIT block also includes an OR1 logic gate of type “OR” configured to perform a logic operation of type “OR” between the mask MSK and the BTE_IN byte. This OR1 logic gate thus makes it possible to generate a second Bl byte at the output.
[0096] The third block WRITEBIT also comprises a selection circuit MUX1 configured to receive the bytes B0 and B1 and to generate a byte BTE_OUT corresponding to the byte B0 or to the byte B1 according to the value of the bit BIT_IN. In particular, if the value of the bit BIT_IN is equal to 0 then the byte BTE_OUT corresponds to the byte B0. Otherwise, the byte BTE_OUT corresponds to the byte B1. The selection circuit MUX1 may in particular be a multiplexer.
[0097] The BTE_OUT byte obtained at the output of the selection circuit MUX1 corresponds to the BTE_IN byte in which the bit pointed to by the bit position pointer BITP has been modified by the value of the BIT_IN bit.
[0098] Thus, the third WRITEBIT block makes it possible to write the value of the bit BIT_IN into the byte BTE_IN at the position pointed to by the bit position pointer BITP. In particular, the third WRITEBIT block is configured to write said bit into the byte BTE_IN in a single cycle of the digital signal processing processor DSP. The resulting byte BTE_OUT with said bit written is stored in the register RI at the output.
[0099] The third WRITEBIT block may share the ADD1, AND2 and SUB1 circuits with the second READBIT block. Alternatively, the ADD1, AND2 and SUB1 circuits of the second READBIT block and the third WRITEBIT block may be distinct.
[0100] As seen previously, the digital signal processing processor DSP is configured to execute a computer program comprising instructions which, when the program is executed, cause the digital signal processing processor DSP to perform a read and / or write access to a bit of a byte of the byte array stored in memory. In particular, the execution of said instructions causes the digital signal processing processor DSP to execute an RD_BIT_NW function or a WRT_BIT_NW function.
[0101] The RD_BIT_NW function is configured to randomly read a bit in a byte array stored in the MEM memory. This RD_BIT_NW function is notably called several times to read all the bits of the BTAB byte array.
[0102] In particular, the computer program PRG is configured to implement the method of read access to a bit stored in the byte table BTAB illustrated in [Fig.4],
[0103] More particularly, the computer program PRG comprises instructions for carrying out an initialization step 40. This step 40 makes it possible to initialize the bit position pointer BITP to the value of a length of the bit sequence of the byte table BTAB reduced by one. This step 40 also makes it possible to initialize the byte pointer to the address of the last byte in the byte array BTAB stored in MEM memory.
[0104] Said function RD_BIT_NW can then be called several times to read the different bits of the byte table BTAB. Calling the function RD_BIT_NW makes it possible to perform steps 41, 42, 43, 44 and 45 described below. Each time the function RD_BIT_NW is called, these steps 41, 42, 43, 44 and 45 are therefore executed.
[0105] In particular, said RD_BIT_NW function is configured to precalculate a next value of a byte offset. To do this, in step 41, the RD_BIT_NW function uses the NXTBBW instruction implemented by the first NXTBBW block of said dedicated circuit. The precalculation of the next value of a byte offset makes it possible to know the next byte to be used for the next read access performed for a next implementation of the RD_BIT_NW function. The NXTBBW instruction makes it possible to anticipate the calculation of the next value of the byte offset before reading the bit in the current byte. This makes it possible to reduce the execution time of the RD_BIT_NW function by reducing the number of execution cycles of the digital signal processing processor DSP.
[0106] Said function RD_BIT_NW is then configured to decrement the bit position pointer, in step 42. Thus the decremented bit position pointer points to the position of the next bit in the byte array BTAB.
[0107] Said RD_BIT_NW function is then configured to read the current byte pointed to by the byte pointer in the byte array, in step 43.
[0108] Said RD_BIT_NW function is then configured to update the byte pointer by adding the byte offset value to the byte pointer, in step 44.
[0109] Said RD_BIT_NW function is then configured to read and then return the current bit, in step 45. To do this, the RD_BIT_NW function uses the READBIT instruction implemented by the second READBIT block of said dedicated circuit.
[0110] In a “multiple issue” or “multi-thread” type processor, i.e. one which can execute several instructions in parallel while taking into account the data dependencies between them, these steps 41, 42, 43, 44 and 45 can be executed either sequentially or in parallel.
[0111] The RD_BIT_NW function uses only the bit position pointer instead of a byte pointer and a mask to read a bit from a byte array. The RB_BIT_NW function therefore uses only one variable instead of two variables. From the bit position pointer, using the first NXTBBW block of the dedicated circuit, it is possible to determine an indexing value of the bit to be read in the current byte of the byte table and to calculate the offset value for the byte containing the next bit to be read. The first NXTBBW block and the second READBIT block of the dedicated HWC circuit are configured to perform all the calculations and tests to extract the bit to be read from a byte in a byte array. This allows the bit to be read more quickly. For example, using the dedicated circuit allows it to be twice as fast as a read access performed solely by software using a byte pointer and a mask.
[0112] Such a RD_BIT_NW function can be used in any application requiring random read access to a bit in a byte array of memory. In particular, the RD_BIT_NW function can be used in any audio coder-decoder requiring random read access to a bit in a byte array of memory. More particularly, the RD_BIT_NW function can be implemented in the “LC3” (Low Complexity Communication Coded) audio coder-decoder. For example, the RD_BIT_NW function can be implemented during the decoding of an audio data stream.
[0113] The computer program may also include instructions which, when the program is executed by the digital signal processing processor DSP, cause it to execute a WRT_BIT_NW function. This WRT_BIT_NW function allows random write access to a bit in a byte array stored in the memory.
[0114] The WRT_BIT_NW function is configured to randomly access a bit in a byte array stored in the MEM memory. This WRT_BIT_NW function is notably called several times to write to all the bits in the BTAB byte array.
[0115] In particular, the computer program PRG is configured to implement the method of writing access to a bit in the byte table BTAB illustrated in [Fig.6].
[0116] More particularly, the computer program PRG comprises instructions for performing an initialization step 60. This step 60 makes it possible to initialize the bit position pointer BITP to the value of a length of the bit sequence of the byte array BTAB reduced by one. This step 60 also makes it possible to initialize the byte pointer to the address of the last byte in the byte array BTAB stored in the memory MEM.
[0117] Said WRT_BIT_NW function can then be called several times to write to the different bits of the BTAB byte table. Calling the WRT_BIT_NW function makes it possible to perform steps 61, 62, 63, 64 and 65 described below. Each time the WRT_BIT_NW function is called, these steps 61, 62, 63, 64 and 65 are therefore executed.
[0118] In particular, said WRT_BIT_NW function is configured to precalculate a next value of a byte offset. To do this, in step 61, the WRT_BIT_NW function uses the NXTBBW instruction implemented by the first block NXTBBW of said dedicated circuit. Precalculating the next value of a byte offset makes it possible to know the next byte to be used for the next write access performed for a future implementation of the WRT_BIT_NW function. The NXTBBW instruction makes it possible to anticipate the calculation of the next value of the byte offset before writing the bit in the current byte. This reduces the execution time of the WRT_BIT_NW function by reducing the number of execution cycles of the digital signal processing processor DSP.
[0119] Said function WRT_BIT_NW is then configured to decrement the bit position pointer, in step 62. Thus the decremented bit position pointer points to the position of the next bit in the byte array BTAB.
[0120] Said WRT_BIT_NW function is then configured to read the current byte pointed to by the byte pointer in the byte array, in step 63.
[0121] Said WRT_BIT_NW function is then configured to update the byte pointer by adding the byte offset value to the byte pointer, in step 64.
[0122] Said WRT_BIT_NW function is then configured to write a BIT_IN bit in the current bit, in step 65. To do this, the WRT_BIT_NW function uses the WRITEBIT instruction implemented by the third WRITEBIT block of said dedicated circuit.
[0123] In a “multiple issue” or “multi-thread” type processor, these steps 61, 62, 63, 64 and 65 can be executed either sequentially or in parallel.
[0124] The WRT_BIT_NW function uses only the bit position pointer instead of a byte pointer and a mask to write a bit to a byte array. The WRT_BIT_NW function therefore uses only one variable instead of two variables. From the bit position pointer, using the first NXTBBW block of the dedicated circuit, it is possible to determine an indexing value of the bit to write to in the current byte of the byte table and to calculate the offset value for the byte containing the next bit to write to. The first NXTBBW block and the third WRITEBIT block of the HWC dedicated circuit are configured to perform all the calculations and tests to write to a bit of a byte array. This allows a one-bit write to be performed more quickly.For example, using the dedicated circuit allows for twice the speed of write access performed solely by software using a byte pointer and a mask.
[0125] Such a WRT_BIT_NW function can be used in any application requiring random write access to a bit in a byte array of memory. In particular, the WRT_BIT_NW function can be used in any audio coder-decoder requiring random read access to a bit in a byte array of memory. More particularly, the WRT_BIT_NW function can be implemented in the “LC3” (Low Complexity Communication Coded) audio coder-decoder.
[0126] Furthermore, the dedicated HWC circuit of the SYS computer system has the advantage of being inexpensive and occupies little space in the computer system. The use of such a dedicated circuit has no impact on the maximum frequency of the digital signal processing processor. The use of such a dedicated circuit also makes it possible to reduce the power consumption for reading a bit in a byte array in the memory.
Claims
Claims
1. Computer system comprising: - a data memory (MEM) configured to store a byte array (BTAB), and a program memory (MEMP) configured to store a computer program (PRG), - a digital signal processing processor (DSP) configured to execute a computer program (PRG) comprising instructions for accessing a bit in said byte array (BTAB), said digital signal processing processor (DSP) being configured to access each byte of said byte array, - a dedicated circuit (HWC) configured to access in reading and / or writing a bit of a byte of said byte array using: • a bit position pointer (BITP) pointing to the bit to be accessed in the byte array, and • said byte (BTE_IN) comprising the bit to be accessed.
2. The system of claim 1, wherein the dedicated circuit (HWC) comprises a first block (NXTBBW) configured to calculate a byte offset value according to the value of the bit position pointer.
3. System according to claim 2, wherein the first block (NXTBBW) of the dedicated circuit (HWC) comprises: - a logic gate (AND1) of type "AND" configured to perform a logic operation of type "AND" between the value of the bit position pointer (BITP) and the hexadecimal value 0x7 to obtain an indexing value (INDX), - a comparison circuit (COMPC) configured to calculate the byte offset value by comparing the indexing value (INDX) to 0, the byte offset value being equal to -1 when the indexing value is equal to 0 and equal to 0 otherwise.
4. System according to any one of claims 2 or 3, wherein the dedicated circuit (HWC) comprises a second block (READBIT) configured to determine the value of a bit to be read from the bit position pointer (BITP) and a byte (BTE_IN) comprising said bit to be read.
5. System according to claim 4, in which the second block (READBIT) of the dedicated circuit (HWC) comprises: - an adder circuit (ADD1) configured to increase the value of the bit position pointer by 1, - a first logic gate (AND2) of the “AND” type configured to perform a logic operation of the “AND” type between the increased value of the bit position pointer and a hexadecimal value equal to 0x7, - a subtractor circuit (SUBI) configured to calculate a shift value (SL) by subtracting a value equal to 7 from the output value of the first logic gate (AND2) of the “AND” type, - a shift circuit (SFT1) configured to shift to the right the value of the byte comprising said bit to be accessed by a number of bits corresponding to said shift value (SL), - a second logic gate (AND3) of the “AND” type configured to perform a logic operation of the “AND” type between a value equal to 1 and the value of the byte shifted so as to obtain the value (BIT_OUT) of the bit to be read.
6. System according to any one of claims 4 or 5, wherein the computer program (PRG) comprises instructions which when implemented by the digital signal processing processor cause the latter to make at least one call to a function (RD_BIT_NW) to read a bit in the byte array (BTAB), each call to this function taking as input the bit position pointer and a byte pointer as attributes and resulting in: - a calculation of a byte offset value by said first block (OFFST), then - an update of the byte pointer by said byte offset value, then - a determination of the value of the bit to be read by said second block (READBIT) of the dedicated circuit (HWC).
7. System according to one of claims 4 to 6, in which the dedicated circuit (HWC) comprises a third block (WRITEBIT) configured to write the value of a bit in place of a bit pointed to by the bit position pointer (BITP) in a byte (BTE_IN) to be written to.
8. System according to claim 7, in which the third block (WRITEBIT) of the dedicated circuit (HWC) comprises: - an adder circuit (ADD1) configured to increase the value of the bit position pointer by 1, - a first logic gate (AND2) of type “AND” configured to perform a logic operation of type “AND” between the increased value of the bit position pointer and a hexadecimal value equal to 0x7, - a subtractor circuit (SUBI) configured to calculate an offset value (SL) by subtracting a value equal to 7 from the output value of the first logic gate (AND2) of the “AND” type, - a shift circuit (SFT2) configured to shift to the left the value 1 by a number of bits corresponding to said shift value (SL) to create a mask (MSK), - an inverting logic gate (NOT1) configured to create a complementary mask (INVMSK) from said mask (MSK) obtained at the output of the shift circuit (SFT2), - a second logic circuit of the “AND” type (AND4) configured to apply the complementary mask (INVMSK) on the byte (BTE_IN) on which to write to obtain a first byte (B0), - a logic circuit of the “OR” type (OR1) configured to apply the mask (MSK) on the byte (BTE_IN) on which to write to obtain a second byte (Bl). - a selection circuit (MUX1) configured to generate a byte (BTE_OUT) corresponding to the first byte (B0) if the value of the bit to be written is equal to 0 or corresponding to the second byte (Bl) otherwise.
9. System according to any one of claims 7 or 8, in which the computer program (PRG) comprises instructions which when implemented by the digital signal processing processor cause the latter to make at least one call to a function (WRT_BIT_NW) to write a bit in the byte array (BTAB), each call to this function taking as input the bit position pointer and a byte pointer as attributes and resulting in: - a calculation of a byte offset value by said first block (OFFST), then - an update of the byte pointer by said byte offset value, then - writing the bit to be written by said third block (WRITEBIT) of the dedicated circuit (HWC).
10. System according to one of claims 1 to 9, in which the computer program (PRG) comprises instructions which when implemented by the digital signal processing (DSP) processor, cause it to initialize the bit position pointer to point to the position of the last bit of the byte array (BTAB), and to decrement said bit position pointer (BITP) on each read and / or write access.
11. Method, implemented by a computer system (SYS), for accessing in reading and / or writing to a bit of a byte stored in a byte array (BTAB) in a data memory (MEM) of said computer system, the method comprising an implementation of instructions of the computer program (PRG) stored in a program memory (MEMP) by a digital signal processing processor (DSP) of the computer system (SYS) resulting in: - an access to said byte stored in the data memory (MEM) by the digital signal processing processor (DSP), - an implementation of a dedicated circuit (HWC) of the computer system (SYS) for accessing in reading and / or writing to said bit of the byte accessed by the digital signal processing processor (DSP) using: • a bit position pointer (BITP) pointing to the bit to be accessed in the byte array, and • said byte (BTE_IN) comprising ... access
12. Method according to claim 11, comprising an implementation of a first block (NXTBBW) of the dedicated circuit (HWC) for calculating a byte offset value (OFFST) according to the value of the bit position pointer (BITP).
13. The method of claim 12, wherein the implementation of the first block (NXTBBW) of the dedicated circuit (HWC) results in: - an implementation of an "AND" type logic gate (AND1) of the first block (NXTBBW) to perform an "AND" type logic operation between the value of the bit position pointer (BITP) and the hexadecimal value 0x7 to obtain an indexing value (INDX), - an implementation of a comparison circuit (COMPC) of the first block (NXTBBW) to calculate the byte offset value by comparing the indexing value (INDX) to 0, the byte offset value being equal to -1 when the indexing value is equal to 0 and equal to 0 otherwise.
14. Method according to any one of claims 12 or 13, further comprising an implementation of a second block (READBIT) of the dedicated circuit (HWC) for determining the value of a bit to be read from the bit position pointer (BITP) and a byte (BTE_IN) comprising said bit to be read.
15. The method of claim 14, wherein the implementation of the second block (READBIT) of the dedicated circuit (HWC) results in: - an implementation of an adder circuit (ADD1) of the second block (READBIT) to increase the value of the bit position pointer by 1, - an implementation of a first logic gate (AND2) of the "AND" type of the second block (READBIT) to perform a logic operation of the "AND" type between the increased value of the bit position pointer and a hexadecimal value equal to 0x7, - an implementation of a subtractor circuit (SUBI) of the second block (READBIT) to calculate a shift value (SL) by subtracting a value equal to 7 from the output value of the first logic gate (AND2) of the "AND" type, - an implementation of a shift circuit (SFT1) of the second block (READBIT) to shift to the right the value of the byte comprising said bit to be accessed by a number of bits corresponding to said offset value (SL),- an implementation of a second logic gate (AND3) of the “AND” type of the second block (READBIT) to perform a logic operation of the “AND” type between a value equal to 1 and the value of the shifted byte so as to obtain the value (BIT_OUT) of the bit to be read.,
16. Method according to any one of claims 14 or 15, comprising an implementation of instructions of the computer program (PRG) by the digital signal processing processor (DSP) causing at least one call of a function (RD_BIT_NW) to read a bit in the byte array (BTAB), each call of this function taking as input the bit position pointer and a byte pointer as attributes and causing: - a calculation of a byte offset value by said first block (OFFST), then - an update of the byte pointer by said byte offset value, then - a determination of the value of the bit to be read by said second block (READBIT) of the dedicated circuit (HWC).
17. A method according to one of claims 11 to 16, further comprising an implementation of a third block (WRITEBIT) of the dedicated circuit (HWC) for writing the value of a bit in place of a bit pointed to by the bit position pointer (BITP) in a byte (BTE_IN) to be written to.
18. The method of claim 17, wherein the implementation of the third block (WRITEBIT) of the dedicated circuit (HWC) results in: - an implementation of an adder circuit (ADD1) of the third block (WRITEBIT) to increase the value of the bit position pointer by 1, - an implementation of a first logic gate (AND2) of the third block (WRITEBIT) to perform a logic operation of the "AND" type between the increased value of the bit position pointer and a hexadecimal value equal to 0x7, - an implementation of a subtractor circuit (SUBI) of the third block (WRITEBIT) to calculate a shift value (SL) by subtracting a value equal to 7 from the output value of the first logic gate (AND2) of the "AND" type, - an implementation of a shift circuit (SFT2) of the third block (WRITEBIT) to shift the value 1 to the left by a number of bits corresponding to said offset value (SL) to create a mask (MSK),- an implementation of an inverting logic gate (NOT1) of the third block (WRITEBIT) to create a complementary mask (INVMSK) from said mask (MSK) obtained by the implementation of the shift circuit (SFT2), - an implementation of a second logic circuit of the “AND” type (AND4) of the third block (WRITEBIT) to apply the complementary mask (INVMSK) to the byte (BTE_IN) to be written to in order to obtain a first byte (B0), - an implementation of an “OR” type logic circuit (OR1) of the third block (WRITEBIT) to apply the mask (MSK) to the byte (BTE_IN) to be written to in order to obtain a second byte (Bl). - an implementation of a selection circuit (MUX1) to generate a byte (BTE_OUT) corresponding to the first byte (B0) if the, value of the bit to be written is equal to 0 or corresponding to the second byte (Bl) otherwise.
19. Method according to any one of claims 17 or 18, comprising an implementation of instructions of the computer program (PRG) by the digital signal processing processor (DSP) causing at least one call of a function (WRT_BIT_NW) to write a bit in the byte array (BTAB), each call of this function taking as input the bit position pointer and a byte pointer as attributes and causing: - a calculation of a byte offset value by said first block (OFFST), then - an update of the byte pointer by said byte offset value, then - a writing of the bit to be written by said third block (WRITEBIT) of the dedicated circuit (HWC).
20. Method according to one of claims 11 to 19, comprising an implementation of instructions of the computer program (PRG) by the digital signal processing processor (DSP) causing an initialization of the bit position pointer so that it points to the position of the last bit of the byte table (BTAB), and a decrementing of said bit position pointer (BITP) at each read and / or write access.
Citation Information
Patent Citations
Slice encoding and decoding processors, circuits, devices, systems and processes
US20110280314A1
Apparatus and method for sequentially parsing bitstreams based on removal of emulation prevention byte
US20120155551A1
Processor-based apparatus and method for processing bit streams
US20130326201A1
Instructions and logic for bit field address and insertion
US20170185402A1