What is 4’d# notation?

embedded

Solution

That looks like verilog to me (or at least it's the same format as verilog uses).

`4'd#` means a 4-bit field, with a decimal value of #.

So `4'd8` is binary `1000`.

Other number formats can be `'h` (hex representation), or `'b` (binary representation)

examples:

16'd1 = 0000000000000001
8'hff = 11111111
5'b10101 = 10101 

(etc).

Problem

In an Atmel datasheet, I see a notation I've never seen before, for example: Register bits MAX_BE define the maximum value of the backoff exponent in the CSMA- CA algorithm. It equals macMaxBE; refer to section 7.5.1.4 of [2]. Valid values are [4’d8, 4’d7, ... , 4’d3]. How does one interpret/decode the 4’d# values?

Original source